Content-Length: 406895 | pFad | http://github.com/python/cpython/pull/136917

A0 gh-136912: fix handling of `OverflowError` in `hmac.digest` by picnixz · Pull Request #136917 · python/cpython · GitHub
Skip to content

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Jul 21, 2025

@picnixz picnixz requested a review from gpshead as a code owner July 21, 2025 10:06
@picnixz picnixz force-pushed the fix/hmac/catch-overflow-error-136912 branch 4 times, most recently from a37c61e to 99d62fe Compare July 21, 2025 10:25
@picnixz picnixz force-pushed the fix/hmac/catch-overflow-error-136912 branch from 99d62fe to d0079c6 Compare July 21, 2025 10:25
@picnixz
Copy link
Member Author

picnixz commented Jul 21, 2025

!buildbot bigmem

@bedevere-bot
Copy link

🤖 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: bigmem

The builders matched are:

  • aarch64 Ubuntu 22.04 BigMem PR
  • AMD64 Windows11 Bigmem PR

@picnixz picnixz marked this pull request as draft July 21, 2025 14:36
@picnixz
Copy link
Member Author

picnixz commented Jul 21, 2025

!buildbot bigmem

@bedevere-bot
Copy link

🤖 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: bigmem

The builders matched are:

  • aarch64 Ubuntu 22.04 BigMem PR
  • AMD64 Windows11 Bigmem PR

@picnixz picnixz marked this pull request as ready for review July 21, 2025 16:03
@picnixz
Copy link
Member Author

picnixz commented Jul 21, 2025

!buildbot bigmem

@bedevere-bot
Copy link

🤖 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: bigmem

The builders matched are:

  • aarch64 Ubuntu 22.04 BigMem PR
  • AMD64 Windows11 Bigmem PR

@picnixz
Copy link
Member Author

picnixz commented Jul 21, 2025

!buildbot bigmem

@bedevere-bot
Copy link

🤖 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: bigmem

The builders matched are:

  • aarch64 Ubuntu 22.04 BigMem PR
  • AMD64 Windows11 Bigmem PR

@picnixz picnixz marked this pull request as draft July 21, 2025 17:26
@@ -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):
Copy link
Member Author

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.

Copy link
Member

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.

@picnixz
Copy link
Member Author

picnixz commented Jul 21, 2025

I'll rewrite this PR tomorrow to use suggestion 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/cpython/pull/136917

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy