]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.9] bpo-40791: Use CRYPTO_memcmp() for compare_digest (GH-20456) (GH-20461)
authorChristian Heimes <christian@python.org>
Thu, 28 May 2020 12:09:38 +0000 (14:09 +0200)
committerGitHub <noreply@github.com>
Thu, 28 May 2020 12:09:38 +0000 (05:09 -0700)
commit8183e11d87388e4e44e3242c42085b87a878f781
tree0b0302ad36f4a4b67a64eb68dc5b280ce84f90f7
parentd23ee5d652ba69a32504dac43131be782b6afdc7
[3.9] bpo-40791: Use CRYPTO_memcmp() for compare_digest (GH-20456) (GH-20461)

hashlib.compare_digest uses OpenSSL's CRYPTO_memcmp() function
when OpenSSL is available.

Note: The _operator module is a builtin module. I don't want to add
libcrypto dependency to libpython. Therefore I duplicated the wrapper
function and added a copy to _hashopenssl.c..
(cherry picked from commit db5aed931f8a617f7b63e773f62db468fe9c5ca1)

Co-authored-by: Christian Heimes <christian@python.org>
Doc/library/hmac.rst
Lib/hmac.py
Lib/test/test_hmac.py
Misc/NEWS.d/next/Library/2020-05-27-18-04-52.bpo-40791.IzpNor.rst [new file with mode: 0644]
Modules/_hashopenssl.c
Modules/_operator.c
Modules/clinic/_hashopenssl.c.h