bpo-44048: Fix two hashlib test cases under FIPS mode#26470
bpo-44048: Fix two hashlib test cases under FIPS mode#26470pablogsal merged 1 commit intopython:mainfrom
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.
Maybe check that the error message contains "unsupported hash type" as well? Ditto for the other test.
There was a problem hiding this comment.
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 <cstratak@redhat.com>
…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 <cstratak@redhat.com> Co-authored-by: stratakis <cstratak@redhat.com>
|
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