I see. So, it is not a Ubuntu bug although it is not that obvious.
1) Some hashing algorithms with MD4 among them were disabled as obsoleted.
2) Cpython shows disabled hashing algorithms as available. Technically it is
correct because they are can be enabled and used. But it does not mean that
they can be used right away. Moreover, the exception you get is too generic and
provides no help whatsoever.
This workaround does the job:
--- /etc/ssl/openssl.cnf.dist 2022-05-04 19:03:33.253072785 +0300
+++ /etc/ssl/openssl.cnf2022-05-04 19:08:48.828690506 +0300
@@ -56,6 +56,7 @@
# List of providers to load
default = default_sect
+legacy = legacy_sect
# The fips section name should match the section name inside the
# included fipsmodule.cnf.
# fips = fips_sect
@@ -71,6 +72,9 @@
# activate = 1
+activate = 1
After that MD4 hash started working:
Python 3.10.4 (main, Apr 2 2022, 09:04:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hashlib
>>> hashlib.new('md4', b"text")
Sebastien, thanks a lot!
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
md4 hash does not work for Python in Jammy
To manage notifications about this bug go to:
ubuntu-bugs mailing list