commit:     b0e43d6bc73cb63642404e661b073d6183fb9aa8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 20 03:37:26 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 21 02:30:24 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b0e43d6b

checksum: add further comments on existing fallback logic for RIPEMD/WHIRLPOOL

Bug: https://github.com/python/cpython/issues/91257
Bug: https://github.com/python/cpython/issues/92876
Bug: https://bugs.gentoo.org/846389
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/checksum.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/portage/checksum.py b/lib/portage/checksum.py
index 96f3939c9..3b9796b32 100644
--- a/lib/portage/checksum.py
+++ b/lib/portage/checksum.py
@@ -99,10 +99,15 @@ class _generate_hash_function:
 # Define hash functions, try to use the best module available. Preferred
 # modules should go first, latter ones should check if the hashes aren't
 # already defined.
-
-
 # Use hashlib if available and prefer it over pycrypto and internal fallbacks.
+#
 # Need special handling for RMD160/WHIRLPOOL as they may not always be 
provided by hashlib.
+# We keep fallbacks for RMD160/WHIRLPOOL for now as newer OpenSSLs don't 
expose them
+# by default.
+# See also
+# - https://github.com/python/cpython/issues/91257
+# - https://github.com/python/cpython/issues/92876
+# - https://bugs.gentoo.org/846389
 _generate_hash_function("MD5", hashlib.md5, origin="hashlib")
 _generate_hash_function("SHA1", hashlib.sha1, origin="hashlib")
 _generate_hash_function("SHA256", hashlib.sha256, origin="hashlib")

Reply via email to