summaryrefslogtreecommitdiff
path: root/Lib/test/test_hashlib.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-29 18:04:22 +0200
committerGitHub <noreply@github.com>2020-04-29 09:04:22 -0700
commite3dfb9b967c560f4d094092dcae4a16fc9634681 (patch)
tree87cce94d1a8858c6a8cf591557a5778d7e01ae65 /Lib/test/test_hashlib.py
parente5963ee32035d279c12ef32e87205d4c3e5e4a0e (diff)
downloadcpython-git-e3dfb9b967c560f4d094092dcae4a16fc9634681.tar.gz
bpo-9216: Expose OpenSSL FIPS_mode() as _hashlib.get_fips_mode() (GH-19703)
test.pythoninfo logs OpenSSL FIPS_mode() and Linux /proc/sys/crypto/fips_enabled in a new "fips" section. Co-Authored-By: Petr Viktorin <encukou@gmail.com>
Diffstat (limited to 'Lib/test/test_hashlib.py')
-rw-r--r--Lib/test/test_hashlib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index 33b687e0b4..31d8e55676 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -856,6 +856,11 @@ class HashLibTestCase(unittest.TestCase):
self.assertEqual(expected_hash, hasher.hexdigest())
+ @unittest.skipUnless(hasattr(c_hashlib, 'get_fips_mode'),
+ 'need _hashlib.get_fips_mode')
+ def test_get_fips_mode(self):
+ self.assertIsInstance(c_hashlib.get_fips_mode(), int)
+
class KDFTests(unittest.TestCase):