From b0e43d6bc73cb63642404e661b073d6183fb9aa8 Mon Sep 17 00:00:00 2001 From: Sam James Date: Mon, 20 Mar 2023 03:37:26 +0000 Subject: 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 --- 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") -- cgit v1.2.3-65-gdbad