Bug 2031149 - ERROR:root:code for hash md5 was not found.
Summary: ERROR:root:code for hash md5 was not found.
Keywords:
Status: CLOSED DUPLICATE of bug 1942527
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: python3.9
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Python Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-10 15:56 UTC by John Sefler
Modified: 2021-12-10 16:54 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-12-10 16:42:51 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-105401 0 None None None 2021-12-10 16:05:59 UTC

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 2021-12-10 16:42:51 UTC

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


Note You need to log in before you can comment on or make changes to this bug.