`hmac.digest()` and `HMAC(...).digest()` disagree when blocksize is smaller than 16
Aperta
@picnixz ci sta già lavorando.
Dal 9/8/2026.
stdlib
type-bug
- Lingua principale
- Python
- Stelle
- 77.2k
- Fork
- 35.9k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Bug report
Bug description:
hmac.digest() and HMAC(...).digest() return DIFFERENT MACs for any digest whose block_size is below 16, because hmac._compute_digest_fallback reads block_size raw while hmac.HMAC._init_old clamps it to 64.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-155429
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.