From 5b5412ea1b27e7a99959ec3c2240b86c1ad3b236 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 7 Sep 2023 08:55:14 -0400 Subject: [PATCH] Remove long pointless indirection (#9558) --- tests/hazmat/primitives/test_rsa.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index 578bb7886ef4..ae28f5cb3a40 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -83,15 +83,6 @@ def _check_fips_key_length(backend, private_key): pytest.skip(f"Key size not FIPS compliant: {private_key.key_size}") -def _check_rsa_private_numbers_if_serializable(key): - if isinstance(key, rsa.RSAPrivateKey): - _check_rsa_private_numbers(key.private_numbers()) - - -def test_check_rsa_private_numbers_if_serializable(): - _check_rsa_private_numbers_if_serializable("notserializable") - - def _flatten_pkcs1_examples(vectors): flattened_vectors = [] for vector in vectors: @@ -192,7 +183,7 @@ def test_generate_rsa_keys(self, backend, public_exponent, key_size): skey = rsa.generate_private_key(public_exponent, key_size, backend) assert skey.key_size == key_size - _check_rsa_private_numbers_if_serializable(skey) + _check_rsa_private_numbers(skey.private_numbers()) pkey = skey.public_key() assert isinstance(pkey.public_numbers(), rsa.RSAPublicNumbers)