]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
wildcard: Require hypothesis 4.41.2 or greater for FIPS compliance
authorMark Andrews <marka@isc.org>
Tue, 21 Dec 2021 22:01:54 +0000 (09:01 +1100)
committerMark Andrews <marka@isc.org>
Mon, 3 Apr 2023 02:44:27 +0000 (12:44 +1000)
hypothesis prior to 4.41.2 uses hashlib.md5 which is not FIPS
compliant causing the wildcard system test to fail.  Check if
we are running if FIPS mode and if so make the minimum version
of hypothesis we will accept to be 4.41.2.

bin/tests/system/wildcard/tests_wildcard.py

index 66166f2a9e7ac56799deea108560b7fe8f40fcd4..d73fd28cd67d3d79490b39e40310d2ae1b1d40ac 100755 (executable)
@@ -39,7 +39,14 @@ import dns.rdataclass
 import dns.rdatatype
 import dns.rrset
 
-pytest.importorskip("hypothesis")
+# in FIPs mode md5 fails so we need 4.41.2 or later which does not use md5
+try:
+    import hashlib
+
+    hashlib.md5(b"1234")
+    pytest.importorskip("hypothesis")
+except ValueError:
+    pytest.importorskip("hypothesis", minversion="4.41.2")
 from hypothesis import given
 from hypothesis.strategies import binary, integers