gh-103256: Fix hmac algorithm to support fallback implementation#103286
gh-103256: Fix hmac algorithm to support fallback implementation#103286corona10 merged 3 commits into
Conversation
|
Would you like to take a look at this PR? |
Sorry, something went wrong.
gpshead
left a comment
There was a problem hiding this comment.
Thanks! somewhat surprised we hadn't run into this at work, but I guess there isn't much demand for hmac-sha3 yet. the other folks who might hit this probably have openssl builds without md5 or sha1?
Sorry, something went wrong.
It looks so, and the latter looks minor case in this era :) |
Sorry, something went wrong.
|
Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
pythongh-103286) (cherry picked from commit efb0a2c) Co-authored-by: Dong-hee Na <donghee.na@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
SHA3 is fine since OpenSSL (at least in Python 3.11.2) provides it; The only hash algorithms that were a problem are ones that OpenSSL doesn't provide via named lookup. So none of the built-in algorithms would trigger it as OpenSSL provides all of them (even whirlpool, mdc2, and the composite md5-sha1 work as expected) - that's why it took me (ab)using hashlib to find it. But patching hashlib (directly in the file or on the fly) to include a new algorithm does trigger it (as that's what I was doing). But you're right that if md5 or sha1 were removed from OpenSSL while still being kept in hashlib (e.g. with a stand-alone CPython implementation), then the problem would get triggered. |
Sorry, something went wrong.
|
Not everyone's OpenSSL provides it. 1.1.1 and BoringSSL do not. |
Sorry, something went wrong.
pythongh-103286) Co-authored-by: Gregory P. Smith <greg@krypto.org>
edited by bedevere-bot
LoadingUh oh!
There was an error while loading. Please reload this page.
Copy link Copy MarkdownSorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.