Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-SSLtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
We are using OpenSSL 3.3.1 with FIPS enabled. When compiling Python version 3.13.1 with --enable-optimizations, test_hashlib will fail with the following.
... fetchinghttp://www.pythontest.net/hashlib/blake2b.txt ... .. fetchinghttp://www.pythontest.net/hashlib/blake2s.txt ... .............ss................. fetchinghttp://www.pythontest.net/hashlib/sha3_224.txt ... .. fetchinghttp://www.pythontest.net/hashlib/sha3_256.txt ... .. fetchinghttp://www.pythontest.net/hashlib/sha3_384.txt ... .. fetchinghttp://www.pythontest.net/hashlib/sha3_512.txt ... ..... fetchinghttp://www.pythontest.net/hashlib/shake_128.txt ... . fetchinghttp://www.pythontest.net/hashlib/shake_256.txt ... .......................EE...E======================================================================ERROR: test_usedforsecurity_false (__main__.HashLibTestCase.test_usedforsecurity_false) ----------------------------------------------------------------------Traceback (mostrecentcalllast): File"/home/user/Python-3.13.1/Lib/test/test_hashlib.py", line246, intest_usedforsecurity_falseself._hashlib.new("md5", usedforsecurity=False) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^_hashlib.UnsupportedDigestmodError: [digitalenveloperoutines] unsupported======================================================================ERROR: test_usedforsecurity_true (__main__.HashLibTestCase.test_usedforsecurity_true) ----------------------------------------------------------------------Traceback (mostrecentcalllast): File"/home/user/Python-3.13.1/Lib/test/test_hashlib.py", line235, intest_usedforsecurity_trueself._hashlib.new("md5", usedforsecurity=True) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^_hashlib.UnsupportedDigestmodError: [digitalenveloperoutines] unsupported======================================================================ERROR: test_scrypt (__main__.KDFTests.test_scrypt) ----------------------------------------------------------------------Traceback (mostrecentcalllast): File"/home/user/Python-3.13.1/Lib/test/test_hashlib.py", line1122, intest_scryptresult=hashlib.scrypt(password, salt=salt, n=n, r=r, p=p) ValueError: [digitalenveloperoutines] unsupported----------------------------------------------------------------------Ran78testsin24.957sFAILED (errors=3, skipped=2)I believe there was a change with 3.12 where test failures no longer fail silently so it would make sense why our Python 3.11 build does not fail.
I did some digging and I found the following PRs and issue which I believe pertain to what I am seeing:
- gh-127298: When in FIPS mode ensure builtin hashes check for usedforsecurity=False #127301
- gh-127298: Refactor test_hashlib for better usedforsecurity & openssl fips mode env support. #127492
- Ensure builtin hashlib implementations honor usedforsecurity=True when _hashlib is in FIPS mode #127298
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-SSLtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error