tpm2-software / tpm2-pytss

Python bindings for TSS
https://tpm2-pytss.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
62 stars 45 forks source link

Import fails with cryptography 42.0.1 #561

Closed bbhtt closed 7 months ago

bbhtt commented 8 months ago

Hi, seeing this with cryptography 42.0.1

python3 -c 'import tpm2_pytss'                                             
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.11/site-packages/tpm2_pytss/__init__.py", line 19, in <module>
    from .ESAPI import ESAPI
  File "/usr/lib/python3.11/site-packages/tpm2_pytss/ESAPI.py", line 2, in <module>
    from .types import *
  File "/usr/lib/python3.11/site-packages/tpm2_pytss/types.py", line 24, in <module>
    from tpm2_pytss.internal.crypto import (
  File "/usr/lib/python3.11/site-packages/tpm2_pytss/internal/crypto.py", line 223, in <module>
    class _MyRSAPrivateNumbers(rsa.RSAPrivateNumbers):
TypeError: type 'cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateNumbers' is not an acceptable base type
whooo commented 8 months ago

If you do a install from https://github.com/tpm2-software/tpm2-pytss/pull/562 does it work for you?

bbhtt commented 8 months ago

Hi, seems to work now. Would be great to have a new release with it

whooo commented 8 months ago

It will be added to the next release