-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-44048: Fix two hashlib test cases under FIPS mode #26470
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
Conversation
test_disallow_instantiation and test_readonly_types try to test all the available digests, however under FIPS mode, while the algorithms are available, trying to use them will fail with a ValueError.
news entry is not required as this is a tests only fix. |
# In FIPS mode some algorithms are not available raising ValueError | ||
try: | ||
h = constructor() | ||
except ValueError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check that the error message contains "unsupported hash type" as well? Ditto for the other test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ValueError would be in this case: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS
However this is specific to OpenSSL in RHEL7 and RHEL8 under FIPS mode. I am not entirely sure what other linux distros would be showing with their downstream FIPS patches (although from the 3.0.0 version of OpenSSL, FIPS compatibility is native so it could be more standardized).
@stratakis does this need backport? |
Thanks @stratakis for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
GH-26531 is a backport of this pull request to the 3.10 branch. |
test_disallow_instantiation and test_readonly_types try to test all the available digests, however under FIPS mode, while the algorithms are available, trying to use them will fail with a ValueError. (cherry picked from commit a46c220) Co-authored-by: stratakis <[email protected]>
…26531) test_disallow_instantiation and test_readonly_types try to test all the available digests, however under FIPS mode, while the algorithms are available, trying to use them will fail with a ValueError. (cherry picked from commit a46c220) Co-authored-by: stratakis <[email protected]> Co-authored-by: stratakis <[email protected]>
Thanks for merging it Pablo. The issue was from 3.10 and onwards and it's now resolved. |
test_disallow_instantiation and test_readonly_types try to test all the available
digests, however under FIPS mode, while the algorithms are available, trying to use
them will fail with a ValueError.
https://bugs.python.org/issue44048