From: Mark Andrews Date: Tue, 21 Dec 2021 22:01:54 +0000 (+1100) Subject: wildcard: Require hypothesis 4.41.2 or greater for FIPS compliance X-Git-Tag: v9.19.12~38^2~11 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=826e2563b315e6d71f7543921ae9ebd38c48c7ac;p=thirdparty%2Fbind9.git wildcard: Require hypothesis 4.41.2 or greater for FIPS compliance 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. --- diff --git a/bin/tests/system/wildcard/tests_wildcard.py b/bin/tests/system/wildcard/tests_wildcard.py index 66166f2a9e7..d73fd28cd67 100755 --- a/bin/tests/system/wildcard/tests_wildcard.py +++ b/bin/tests/system/wildcard/tests_wildcard.py @@ -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