From d54093e62e7e68c02efbb4d6a09162ddb39bf72f Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 22 Jan 2024 08:07:53 -0500 Subject: [PATCH] Remove some skips in tests that aren't needed anymore (#10223) --- tests/hazmat/primitives/test_dh.py | 18 ++++-------------- tests/hazmat/primitives/test_rsa.py | 11 ----------- tests/x509/test_x509.py | 8 -------- 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/tests/hazmat/primitives/test_dh.py b/tests/hazmat/primitives/test_dh.py index a8c5325891d2..9caded2cc2ac 100644 --- a/tests/hazmat/primitives/test_dh.py +++ b/tests/hazmat/primitives/test_dh.py @@ -753,38 +753,33 @@ def test_public_bytes_match( @pytest.mark.skip_fips(reason="non-FIPS parameters") @pytest.mark.parametrize( - ("key_path", "loader_func", "vec_path", "is_dhx"), + ("key_path", "loader_func", "vec_path"), [ ( os.path.join("asymmetric", "DH", "dhpub.pem"), serialization.load_pem_public_key, os.path.join("asymmetric", "DH", "dhkey.txt"), - False, ), ( os.path.join("asymmetric", "DH", "dhpub.der"), serialization.load_der_public_key, os.path.join("asymmetric", "DH", "dhkey.txt"), - False, ), ( os.path.join("asymmetric", "DH", "dhpub_rfc5114_2.pem"), serialization.load_pem_public_key, os.path.join("asymmetric", "DH", "dhkey_rfc5114_2.txt"), - True, ), ( os.path.join("asymmetric", "DH", "dhpub_rfc5114_2.der"), serialization.load_der_public_key, os.path.join("asymmetric", "DH", "dhkey_rfc5114_2.txt"), - True, ), ], ) def test_public_bytes_values( - self, key_path, loader_func, vec_path, is_dhx, backend + self, key_path, loader_func, vec_path, backend ): - _skip_dhx_unsupported(backend, is_dhx) key_bytes = load_vectors_from_file( key_path, lambda pemfile: pemfile.read(), mode="rb" ) @@ -882,38 +877,33 @@ def test_parameter_bytes_match( assert serialized == param_bytes @pytest.mark.parametrize( - ("param_path", "loader_func", "vec_path", "is_dhx"), + ("param_path", "loader_func", "vec_path"), [ ( os.path.join("asymmetric", "DH", "dhp.pem"), serialization.load_pem_parameters, os.path.join("asymmetric", "DH", "dhkey.txt"), - False, ), ( os.path.join("asymmetric", "DH", "dhp.der"), serialization.load_der_parameters, os.path.join("asymmetric", "DH", "dhkey.txt"), - False, ), ( os.path.join("asymmetric", "DH", "dhp_rfc5114_2.pem"), serialization.load_pem_parameters, os.path.join("asymmetric", "DH", "dhkey_rfc5114_2.txt"), - True, ), ( os.path.join("asymmetric", "DH", "dhp_rfc5114_2.der"), serialization.load_der_parameters, os.path.join("asymmetric", "DH", "dhkey_rfc5114_2.txt"), - True, ), ], ) def test_public_bytes_values( - self, param_path, loader_func, vec_path, backend, is_dhx + self, param_path, loader_func, vec_path, backend ): - _skip_dhx_unsupported(backend, is_dhx) key_bytes = load_vectors_from_file( param_path, lambda pemfile: pemfile.read(), mode="rb" ) diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index 205f294bffe6..10a84cb08665 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -292,17 +292,6 @@ def test_load_pss_keys_strips_constraints(self, path, backend): signature, b"whatever", padding.PKCS1v15(), hashes.SHA224() ) - @pytest.mark.supported( - only_if=lambda backend: ( - not backend._lib.CRYPTOGRAPHY_IS_BORINGSSL - and ( - not backend._lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_111E - or backend._lib.CRYPTOGRAPHY_IS_LIBRESSL - and not backend._lib.CRYPTOGRAPHY_LIBRESSL_LESS_THAN_380 - ) - ), - skip_message="Does not support RSA PSS loading", - ) def test_load_pss_pub_keys_strips_constraints(self, backend): key = load_vectors_from_file( filename=os.path.join( diff --git a/tests/x509/test_x509.py b/tests/x509/test_x509.py index 8d40481b47c6..1a6fc7b437cc 100644 --- a/tests/x509/test_x509.py +++ b/tests/x509/test_x509.py @@ -792,14 +792,6 @@ def test_get_revoked_certificate_doesnt_reorder( assert crl[2].serial_number == 3 -@pytest.mark.supported( - only_if=lambda backend: ( - not backend._lib.CRYPTOGRAPHY_IS_LIBRESSL - and not backend._lib.CRYPTOGRAPHY_IS_BORINGSSL - and not backend._lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_111E - ), - skip_message="Does not support RSA PSS loading", -) class TestRSAPSSCertificate: def test_load_cert_pub_key(self, backend): cert = _load_cert(