diff --git a/test/test_crypto.py b/test/test_crypto.py index 2fc53464..008b1645 100644 --- a/test/test_crypto.py +++ b/test/test_crypto.py @@ -185,7 +185,7 @@ def test_rsa_encryption_roundtrip_der(self): self.assertEqual(test_pt, pt) public_key_der_bytes = base64.b64decode(RSA_PUBLIC_KEY_DER_BASE64) - rsa_pub = RSA.new_public_key_from_der_data(decoded_public_key) + rsa_pub = RSA.new_public_key_from_der_data(public_key_der_bytes) ct_pub = rsa_pub.encrypt(p, test_pt) pt_pub = rsa.decrypt(p, ct_pub) self.assertEqual(test_pt, pt_pub) @@ -230,8 +230,8 @@ def test_rsa_signing_roundtrip_der(self): signature = rsa.sign(p, digest) self.assertTrue(rsa.verify(p, digest, signature)) - private_key_der_bytes = base64.b64decode(RSA_PUBLIC_KEY_DER_BASE64) - rsa_pub = RSA.new_public_key_from_der_data(private_key_der_bytes) + public_key_der_bytes = base64.b64decode(RSA_PUBLIC_KEY_DER_BASE64) + rsa_pub = RSA.new_public_key_from_der_data(public_key_der_bytes) self.assertTrue(rsa_pub.verify(p, digest, signature)) def test_rsa_load_error(self):