From f7888eb46e9753d65fa2d4f3c24838bee8aad814 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 26 Jan 2024 10:14:39 -0500 Subject: fixed fips skip condition (#10264) --- tests/hazmat/primitives/test_dh.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/hazmat/primitives/test_dh.py b/tests/hazmat/primitives/test_dh.py index 9caded2..4b3b63a 100644 --- a/tests/hazmat/primitives/test_dh.py +++ b/tests/hazmat/primitives/test_dh.py @@ -164,10 +164,7 @@ class TestDH: ) def test_dh_parameters_allows_rfc3526_groups(self, backend, vector): p = int.from_bytes(binascii.unhexlify(vector["p"]), "big") - if ( - backend._fips_enabled - and p.bit_length() < backend._fips_dh_min_modulus - ): + if backend._fips_enabled and p < backend._fips_dh_min_modulus: pytest.skip("modulus too small for FIPS mode") params = dh.DHParameterNumbers(p, int(vector["g"])) -- cgit v1.1