Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2031149

Summary: ERROR:root:code for hash md5 was not found.
Product: Red Hat Enterprise Linux 9 Reporter: John Sefler <jsefler>
Component: python3.9Assignee: Python Maintainers <python-maint>
Status: CLOSED DUPLICATE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: cstratak, pviktori
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-10 16:42:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Sefler 2021-12-10 15:56:16 UTC
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:

Comment 3 Petr Viktorin (pviktori) 2021-12-10 16:42:51 UTC

*** This bug has been marked as a duplicate of bug 1942527 ***