Ensure that HMAC objects are properly initialized
Aperta
@picnixz ci sta già lavorando.
Dal 15/8/2026.
extension-modules
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:
This affects the following situations:
_hmac.new()frees an uninitialized HACL pointer when the key exceedsUINT32_MAX_hmac_HMAC_copy_implrunsHASHLIB_INIT_MUTEX(copy)after the falliblehmac_copy_state
The solution is simply to always entirely initialize the HMAC object before working with it. We also change the usage of PyObject_New to tp->tp_alloc directly so that we only alter fields for which the 0-value would not be suitable.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-155845
- gh-157036
- gh-157037
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.