summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2019-09-30 07:10:38 (GMT)
committerƁukasz Langa <lukasz@langa.pl>2019-09-30 07:10:38 (GMT)
commitbfca56b3ddb4bb0a98931ebcd1257af2afa9b2ae (patch)
treeff07fa2582af47ceddc050bf034b3ba25be48643 /Modules
parent1aeb720d64021e544043ca4619a44a7da0cd00dd (diff)
downloadcpython-bfca56b3ddb4bb0a98931ebcd1257af2afa9b2ae.zip
cpython-bfca56b3ddb4bb0a98931ebcd1257af2afa9b2ae.tar.gz
cpython-bfca56b3ddb4bb0a98931ebcd1257af2afa9b2ae.tar.bz2
[3.8] bpo-38270: More fixes for strict crypto policy (GH-16418) (#16437)
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. (cherry picked from commit 90558158093c0ad893102158fd3c2dd9f864e82e) Co-authored-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_hashopenssl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
index 84906a4..1513e4e 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -556,7 +556,7 @@ EVPnew(const EVP_MD *digest,
if ((self = newEVPobject()) == NULL)
return NULL;
- if (!EVP_DigestInit(self->ctx, digest)) {
+ if (!EVP_DigestInit_ex(self->ctx, digest, NULL)) {
_setException(PyExc_ValueError);
Py_DECREF(self);
return NULL;