]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45150: Fix testing under FIPS mode (GH-32046)
authorChristian Heimes <christian@python.org>
Tue, 22 Mar 2022 15:40:43 +0000 (17:40 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Mar 2022 15:40:43 +0000 (16:40 +0100)
Lib/test/test_hashlib.py

index daf6e3862a24f72a19aa7d77192b07573e05c50e..369bbde6e78b6d7d9820c50e07ee08a3da9b6104 100644 (file)
@@ -379,6 +379,11 @@ class HashLibTestCase(unittest.TestCase):
 
     def check_file_digest(self, name, data, hexdigest):
         hexdigest = hexdigest.lower()
+        try:
+            hashlib.new(name)
+        except ValueError:
+            # skip, algorithm is blocked by security policy.
+            return
         digests = [name]
         digests.extend(self.constructors_to_test[name])