]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-135759: consistently reject negative sizes in SHAKE digests (#135767)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sat, 21 Jun 2025 09:43:30 +0000 (11:43 +0200)
committerGitHub <noreply@github.com>
Sat, 21 Jun 2025 09:43:30 +0000 (09:43 +0000)
commit7c4361564c3881946a5eca677607b4ffec0a566d
treed0f0078114b1bf642d744b9283de8b36fac4ff2c
parent13cac833471885564cbfde72a4cbac64ade3137a
gh-135759: consistently reject negative sizes in SHAKE digests (#135767)

Passing a negative digest length to `_hashilb.HASHXOF.[hex]digest()` now
raises a ValueError instead of a MemoryError or a SystemError. This makes
the behavior consistent with that of `_sha3.shake_{128,256}.[hex]digest`.
Lib/test/test_hashlib.py
Misc/NEWS.d/next/Library/2025-06-20-16-28-47.gh-issue-135759.jne0Zi.rst [new file with mode: 0644]
Modules/_hashopenssl.c
Modules/clinic/sha3module.c.h
Modules/sha3module.c