Skip to content

Commit

Permalink
Remove long pointless indirection
Browse files Browse the repository at this point in the history
  • Loading branch information
alex authored Sep 7, 2023
1 parent bff4c76 commit 940a2ab
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions tests/hazmat/primitives/test_rsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 940a2ab

Please sign in to comment.