]> granicus.if.org Git - python/commit
[3.8] bpo-38270: More fixes for strict crypto policy (GH-16418) (#16437)
authorChristian Heimes <christian@python.org>
Mon, 30 Sep 2019 07:10:38 +0000 (09:10 +0200)
committerŁukasz Langa <lukasz@langa.pl>
Mon, 30 Sep 2019 07:10:38 +0000 (09:10 +0200)
commitbfca56b3ddb4bb0a98931ebcd1257af2afa9b2ae
treeff07fa2582af47ceddc050bf034b3ba25be48643
parent1aeb720d64021e544043ca4619a44a7da0cd00dd
[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>
Lib/test/support/__init__.py
Lib/test/test_hashlib.py
Lib/test/test_hmac.py
Modules/_hashopenssl.c