diff --git a/test/test_crypto.py b/test/test_crypto.py index b8a2a4e9..7abbecb4 100644 --- a/test/test_crypto.py +++ b/test/test_crypto.py @@ -8,6 +8,7 @@ from base64 import b64decode from hashlib import sha256, sha384 from cryptography.hazmat.primitives.serialization import load_pem_public_key +from cryptography.exceptions import UnsupportedAlgorithm rsa_private_key = b""" -----BEGIN RSA PRIVATE KEY----- @@ -206,7 +207,7 @@ def setUp(self): self._has_sect163r2 = True try: load_pem_public_key(ecc_bad_curve) - except ValueError: + except (ValueError, UnsupportedAlgorithm): self._has_sect163r2 = False def test_public_from_pem_rsa(self):