Description of problem: When FIPS mode is enabled on a RHEL9.0 system, python3 is throwing the following traceback... [root@kvm-08-guest16 ~]# python3 -c 'import hashlib' ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/lib64/python3.9/hashlib.py", line 137, in __get_openssl_constructor f(usedforsecurity=False) ValueError: [digital envelope routines] initialization error During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib64/python3.9/hashlib.py", line 255, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/lib64/python3.9/hashlib.py", line 141, in __get_openssl_constructor return __get_builtin_constructor(name) File "/usr/lib64/python3.9/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 Version-Release number of selected component (if applicable): DISTRO=RHEL-9.0.0-20211128.3 [root@kvm-08-guest16 ~]# rpm -q openssl python3 openssl-3.0.0-4.el9.x86_64 python3-3.9.9-1.el9.x86_64 How reproducible: Steps to Reproduce: Use Beaker to reserve a RHEL-9.0 system with Task /distribution/fips/setup-fips-enabled and then... [root@kvm-08-guest16 ~]# fips-mode-setup --check FIPS mode is enabled. [root@kvm-08-guest16 ~]# sysctl crypto.fips_enabled crypto.fips_enabled = 1 [root@kvm-08-guest16 ~]# update-crypto-policies --show ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/lib64/python3.9/random.py", line 61, in <module> from _sha512 import sha512 as _sha512 ModuleNotFoundError: No module named '_sha512' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib64/python3.9/hashlib.py", line 137, in __get_openssl_constructor f(usedforsecurity=False) ValueError: [digital envelope routines] initialization error During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib64/python3.9/hashlib.py", line 255, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/lib64/python3.9/hashlib.py", line 141, in __get_openssl_constructor return __get_builtin_constructor(name) File "/usr/lib64/python3.9/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 FIPS [root@kvm-08-guest16 ~]# python3 -c 'import hashlib' ERROR:root:code for hash md5 was not found. Traceback (most recent call last): File "/usr/lib64/python3.9/hashlib.py", line 137, in __get_openssl_constructor f(usedforsecurity=False) ValueError: [digital envelope routines] initialization error During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib64/python3.9/hashlib.py", line 255, in <module> globals()[__func_name] = __get_hash(__func_name) File "/usr/lib64/python3.9/hashlib.py", line 141, in __get_openssl_constructor return __get_builtin_constructor(name) File "/usr/lib64/python3.9/hashlib.py", line 123, in __get_builtin_constructor raise ValueError('unsupported hash type ' + name) ValueError: unsupported hash type md5 Actual results: attempts to 'import hashlib' by python3 are throwing a traceback with ERROR:root:code for hash md5 was not found. Expected results: no error Additional info:
*** This bug has been marked as a duplicate of bug 1942527 ***