-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-135571: Guard _hashlib usage in test_hashlib.py #135572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
gh-135571: Guard _hashlib usage in test_hashlib.py #135572
Conversation
Co-authored-by: Bénédikt Tran <[email protected]>
# Make sure that _hashlib contains the constructor | ||
# to test when using a combination of libcrypto and | ||
# interned hash implementations. | ||
if self._hashlib and digest_name in self._hashlib._constructors: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, this seems the correct way to guard it but there are other places where we do self._hashlib.new('md5')
and this works because all libcrypto libs actually expose 'md5'. Id assume that the issue is with blake2 right? or is it another hash function that is causing the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of hash functions provided by hashlib
, the only gap I'm aware of between OpenSSL and (some) other libcrypto
s is BLAKE2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to merge @picnixz?
Notes
See here.
Testing
See here.