latchset / jwcrypto

Implements JWK,JWS,JWE specifications using python-cryptography
GNU Lesser General Public License v3.0
439 stars 118 forks source link

Issue with cryptography dependency declaration #305

Closed prusse-martin closed 2 years ago

prusse-martin commented 2 years ago

The cryptography dependency is declared as cryptography >= 2.3, but jwcrypto no longer work with older cryptography. I tested with cryptography ==2.3.1 and the error is displayed bellow. In a quick check in the cryptography repo looks like SHA3_224 was add after 2.4, testing with 2.5 the import did work.

I suggest to update the dependency declaration. I did not check if there are other problems due using older versions of cryptography.

W:\my\Projects
(jwcrypto-test) λ conda list cryp
# packages in environment at W:\my\envs\jwcrypto-test:
#
# Name                    Version                   Build  Channel
asn1crypto                1.5.1            py37haa95532_0    defaults
cryptography              2.3.1            py37h74b6da3_0    defaults
jwcrypto                  1.4.2              pyhd8ed1ab_0    https://conda.anaconda.org/conda-forge

W:\my\Projects
(jwcrypto-test) λ python -c "from jwcrypto import jwk"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "W:\my\envs\jwcrypto-test\lib\site-packages\jwcrypto\jwk.py", line 200, in <module>
    'sha3-224': hashes.SHA3_224(),
AttributeError: module 'cryptography.hazmat.primitives.hashes' has no attribute 'SHA3_224'
simo5 commented 2 years ago

Do you want to submit a PR to update the minimum dependency to a version that work ?