-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-136912: fix handling of OverflowError
in hmac.digest
#136917
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?
Conversation
a37c61e
to
99d62fe
Compare
99d62fe
to
d0079c6
Compare
!buildbot bigmem |
🤖 New build scheduled with the buildbot fleet by @picnixz for commit d0079c6 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136917%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
!buildbot bigmem |
🤖 New build scheduled with the buildbot fleet by @picnixz for commit f93e1ba 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136917%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
!buildbot bigmem |
🤖 New build scheduled with the buildbot fleet by @picnixz for commit df36d7d 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136917%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
!buildbot bigmem |
🤖 New build scheduled with the buildbot fleet by @picnixz for commit 74239be 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136917%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
@@ -241,13 +241,20 @@ def digest(key, msg, digest): | |||
if _hashopenssl and isinstance(digest, (str, _functype)): | |||
try: | |||
return _hashopenssl.hmac_digest(key, msg, digest) | |||
except OverflowError as exc: | |||
if (not _hmac and isinstance(digest, str)) or callable(digest): |
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.
I still need to convince myself that this is the correct way to do it. I'm too tired to think.
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.
as written this would silently ignore the exception when this does not match.
I'll rewrite this PR tomorrow to use suggestion 4. |
Uh oh!
There was an error while loading. Please reload this page.