mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-40791: Use CRYPTO_memcmp() for compare_digest (#20456)
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.
This commit is contained in:
parent
210a137396
commit
db5aed931f
7 changed files with 221 additions and 37 deletions
|
@ -785,6 +785,8 @@ _operator_length_hint_impl(PyObject *module, PyObject *obj,
|
|||
return PyObject_LengthHint(obj, default_value);
|
||||
}
|
||||
|
||||
/* NOTE: Keep in sync with _hashopenssl.c implementation. */
|
||||
|
||||
/*[clinic input]
|
||||
_operator._compare_digest = _operator.eq
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue