bpo-40791: Use CRYPTO_memcmp() for compare_digest by tiran · Pull Request #20456 · python/cpython

@tiran

:func:`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``.

Signed-off-by: Christian Heimes <christian@python.org>

gpshead

@tiran tiran deleted the bpo-40791-openssl-compare-digest branch

May 27, 2020 19:50

tiran added a commit to tiran/cpython that referenced this pull request

May 27, 2020
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 db5aed9)

Co-authored-by: Christian Heimes <christian@python.org>

miss-islington pushed a commit that referenced this pull request

May 28, 2020
…H-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 db5aed9)

Co-authored-by: Christian Heimes <christian@python.org>

@ssbr ssbr mannequin mentioned this pull request

Aug 24, 2023