-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-SSLtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
If additional OpenSSL backends are loaded at runtime (this happens e.g. when importing PyOpenSSL), the hashlib.algorithms_available doesn't get updated for the newly available hashes.
Trivial reproducer:
>>> import ctypes, hashlib
>>> ctypes.CDLL("libssl.so").OSSL_PROVIDER_load(None, b"legacy")
-1311283920
>>> "md4" in hashlib.algorithms_available
False
>>> hashlib.new("md4")
<md4 _hashlib.HASH object @ 0x7f404308faf0>Your environment
- CPython versions tested on: 3.11.0b1, 3.10.4 with 1b6acaa backported, 3.9.12
- Operating system and architecture: Gentoo Linux amd64
- OpenSSL version: 3.0.3
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-SSLtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error