Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.14] gh-136912: fix handling ofOverflowError inhmac.digest (GH-136917)#137116

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
picnixz merged 2 commits intopython:3.14frompicnixz:backport-d658b90-3.14
Oct 8, 2025

Conversation

@picnixz
Copy link
Member

@picnixzpicnixz commentedJul 26, 2025
edited by bedevere-appbot
Loading

The OpenSSL and HACL* implementations of HMAC single-shot digest computation reject keys whose length exceedsINT_MAX andUINT32_MAX respectively. The OpenSSL implementation also rejects messages whose length exceedINT_MAX.

Using such keys inhmac.digest previously raised anOverflowError which was propagated to the caller. This commit mitigates this case by makinghmac.digest fall back to HMAC's pure Python implementation which accepts arbitrary large keys or messages.

This change only affects the top-level entrypointhmac.digest, leaving_hashopenssl.hmac_digest and_hmac.compute_digest untouched.

(cherry picked from commitd658b90)

…st` (pythonGH-136917)The OpenSSL and HACL* implementations of HMAC single-shotdigest computation reject keys whose length exceeds `INT_MAX`and `UINT32_MAX` respectively. The OpenSSL implementationalso rejects messages whose length exceed `INT_MAX`.Using such keys in `hmac.digest` previously raised an `OverflowError`which was propagated to the caller. This commit mitigates this case bymaking `hmac.digest` fall back to HMAC's pure Python implementationwhich accepts arbitrary large keys or messages.This change only affects the top-level entrypoint `hmac.digest`, leaving`_hashopenssl.hmac_digest` and `_hmac.compute_digest` untouched.(cherry picked from commitd658b90)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@gpshead
Copy link
Member

waiting for 3.14.1

picnixz and hugovk reacted with thumbs up emoji

@vstinner
Copy link
Member

vstinner commentedOct 7, 2025
edited
Loading

@picnixz: Is it still a draft? The 3.14 branch was reopened for 3.14.1 changes.

picnixz reacted with thumbs up emoji

@picnixzpicnixz marked this pull request as ready for reviewOctober 8, 2025 09:57
@picnixzpicnixz merged commit8ad6eda intopython:3.14Oct 8, 2025
52 checks passed
@picnixzpicnixz deleted the backport-d658b90-3.14 branchOctober 8, 2025 10:09
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gpsheadgpsheadgpshead approved these changes

Assignees

@gpsheadgpshead

@picnixzpicnixz

Labels

None yet

Projects

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@picnixz@gpshead@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp