-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hashlib.algorithms_available lists algorithms that are not available in OpenSSL 3.0 default provider #91257
Comments
Hubert Kario wrote in https://bugzilla.redhat.com/show_bug.cgi?id=2054702 Description of problem: Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce:
Actual results: Traceback (most recent call last):
File "/usr/lib64/python3.9/hashlib.py", line 164, in __hash_new
return _hashlib.new(name, data, **kwargs)
ValueError: [digital envelope routines] unsupported
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <setcomp>
File "/usr/lib64/python3.9/hashlib.py", line 170, in __hash_new
return __get_builtin_constructor(name)(data)
File "/usr/lib64/python3.9/hashlib.py", line 127, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type whirlpool Expected results: {('blake2b', 64), ('sha512', 64), ('md5-sha1', 36), ('sha3_512', 64), ('md5', 16), ('sha224', 28), ('shake_128', 0), ('sm3', 32), ('blake2s', 32), ('sha1', 20), ('shake_256', 0), ('sha512_256', 32), ('sha3_224', 28), ('sha3_256', 32), ('sha3_384', 48), ('sha384', 48), ('sha256', 32), ('sha512_224', 28)} Additional info: It may be caused by Python using the deprecated EVP_MD_do_all() method instead of the EVP_MD_do_all_provided() method |
Hubert's suggested solution EVP_MD_do_all_provided() worked almost straight forward. The function signature is a bit different and I got "undefined" in the result set. Filtering out NID_undef got right of it. |
$ ./python Tools/ssl/multissltests.py --openssl 3.0.2 --steps modules
$ ./python -c "import hashlib; print(hashlib.algorithms_available)"
{'blake2b', 'sha512', 'sm3', 'shake_128', 'md5', 'sha3_256', 'sha224', 'sha512_224', 'sha3_384', 'sha384', 'md5-sha1', 'sha3_224', 'shake_256', 'sha3_512', 'sha512_256', 'sha1', 'sha256', 'blake2s'} |
@tiran: It looks like this has been fixed: should the issue be closed? |
Hashlib still needs to load the legacy provider to achieve parity with 1.1.1 builds, but that's tracked in #92876. |
…WHIRLPOOL Bug: python/cpython#91257 Bug: python/cpython#92876 Bug: https://bugs.gentoo.org/846389 Signed-off-by: Sam James <[email protected]>
…WHIRLPOOL Bug: python/cpython#91257 Bug: python/cpython#92876 Bug: https://bugs.gentoo.org/846389 Signed-off-by: Sam James <[email protected]>
…WHIRLPOOL Bug: python/cpython#91257 Bug: python/cpython#92876 Bug: https://bugs.gentoo.org/846389 Signed-off-by: Sam James <[email protected]>
…WHIRLPOOL Bug: python/cpython#91257 Bug: python/cpython#92876 Bug: https://bugs.gentoo.org/846389 Signed-off-by: Sam James <[email protected]>
…WHIRLPOOL Bug: python/cpython#91257 Bug: python/cpython#92876 Bug: https://bugs.gentoo.org/846389 Signed-off-by: Sam James <[email protected]>
An algorithm could be a part of hashlib.algorithms_available set, but still uninstantiatable in current runtime configuration. See: python/cpython#91257.
An algorithm could be a part of hashlib.algorithms_available set, but still uninstantiatable in current runtime configuration. See: python/cpython#91257.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: