Skip to content

gh-155426: correctly reject non-bytes keys in hmac.digest - #155427

Merged
picnixz merged 3 commits into
python:mainfrom
picnixz:meta/crypto/py/hmac/key-ljust-invalid-155426
Oct 19, 2026
Merged

picnixz merged 3 commits into
python:mainfrom
picnixz:meta/crypto/py/hmac/key-ljust-invalid-155426

Conversation

@picnixz

@picnixz picnixz commented Aug 9, 2026 •

Copy link
Copy Markdown
Member

This only affects keys of length smaller than the HMAC blocksize
since larger keys are hashed first.
@picnixz
picnixz force-pushed the meta/crypto/py/hmac/key-ljust-invalid-155426 branch from fe28b30 to 0c1bf69 Compare August 9, 2026 12:42
@picnixz picnixz changed the title gh-155426: correctly accept bytes-like keys in hmac.digest gh-155426: correctly reject non-bytes keys in hmac.digest Aug 9, 2026
@picnixz picnixz added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Aug 9, 2026
Comment thread Misc/NEWS.d/next/Library/2026-08-09-14-06-27.gh-issue-155426.zZVPMd.rst Outdated
@picnixz picnixz removed the needs backport to 3.13 only security fixes label Oct 19, 2026
@picnixz picnixz self-assigned this Oct 19, 2026
@picnixz
picnixz merged commit 197d332 into python:main Oct 19, 2026
53 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@picnixz
picnixz deleted the meta/crypto/py/hmac/key-ljust-invalid-155426 branch October 19, 2026 19:37
@bedevere-app

bedevere-app Bot commented Oct 19, 2026

Copy link
Copy Markdown

GH-159743 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 19, 2026
@bedevere-app

bedevere-app Bot commented Oct 19, 2026

Copy link
Copy Markdown

GH-159744 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 19, 2026
picnixz added a commit that referenced this pull request Oct 19, 2026
…H-155427) (#159743)

This only affects keys of length smaller than the HMAC blocksize
since larger keys are hashed first.

(cherry picked from commit 197d332)

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz added a commit that referenced this pull request Oct 19, 2026
…H-155427) (#159744)

This only affects keys of length smaller than the HMAC blocksize
since larger keys are hashed first.

(cherry picked from commit 197d332)

---------

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
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.

1 participant