summaryrefslogtreecommitdiffstats
path: root/Modules/_hashopenssl.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2019-09-27 13:03:53 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-09-27 13:03:53 (GMT)
commit90558158093c0ad893102158fd3c2dd9f864e82e (patch)
tree75085b7aaef52d558894a0ec1bc4a31b6f4ef2a2 /Modules/_hashopenssl.c
parent5faff977adbe089e1f91a5916ccb2160a22dd292 (diff)
downloadcpython-90558158093c0ad893102158fd3c2dd9f864e82e.zip
cpython-90558158093c0ad893102158fd3c2dd9f864e82e.tar.gz
cpython-90558158093c0ad893102158fd3c2dd9f864e82e.tar.bz2
bpo-38270: More fixes for strict crypto policy (GH-16418)
test_hmac and test_hashlib test built-in hashing implementations and OpenSSL-based hashing implementations. Add more checks to skip OpenSSL implementations when a strict crypto policy is active. Use EVP_DigestInit_ex() instead of EVP_DigestInit() to initialize the EVP context. The EVP_DigestInit() function clears alls flags and breaks usedforsecurity flag again. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38270
Diffstat (limited to 'Modules/_hashopenssl.c')
-rw-r--r--Modules/_hashopenssl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index 48511f7..b147dbe 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -552,7 +552,7 @@ EVPnew(const EVP_MD *digest,
}
- if (!EVP_DigestInit(self->ctx, digest)) {
+ if (!EVP_DigestInit_ex(self->ctx, digest, NULL)) {
_setException(PyExc_ValueError);
Py_DECREF(self);
return NULL;