diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-06-19 10:16:42 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-06-19 10:16:42 -0600 |
commit | f2fb02a2c42395d5b3b0f161a127234452a2a976 (patch) | |
tree | 6efe74db2c29574238219f96df72c8d65e135381 /tests/hazmat/backends/test_openssl.py | |
parent | 12a4e0fd70476a3b54193a12aa760b100baaa019 (diff) | |
download | cryptography-f2fb02a2c42395d5b3b0f161a127234452a2a976.tar.gz cryptography-f2fb02a2c42395d5b3b0f161a127234452a2a976.tar.bz2 cryptography-f2fb02a2c42395d5b3b0f161a127234452a2a976.zip |
deprecate old RSA classes and methods
Diffstat (limited to 'tests/hazmat/backends/test_openssl.py')
-rw-r--r-- | tests/hazmat/backends/test_openssl.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index 75369efc..f9e692b4 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -488,3 +488,41 @@ class TestOpenSSLNoEllipticCurve(object): monkeypatch.setattr(backend._lib, "Cryptography_HAS_EC", 0) assert backend._supported_curves() == [] + + +class TestDeprecatedRSABackendMethods(object): + def test_create_rsa_signature_ctx(self): + private_key = rsa.RSAPrivateKey.generate(65537, 512, backend) + pytest.deprecated_call( + backend.create_rsa_signature_ctx, + private_key, + padding.PKCS1v15(), + hashes.SHA1() + ) + + def test_create_rsa_verification_ctx(self): + private_key = rsa.RSAPrivateKey.generate(65537, 512, backend) + public_key = private_key.public_key() + pytest.deprecated_call( + backend.create_rsa_verification_ctx, + public_key, + b"\x00" * 64, + padding.PKCS1v15(), + hashes.SHA1() + ) + + def test_encrypt_decrypt_rsa(self): + private_key = rsa.RSAPrivateKey.generate(65537, 512, backend) + public_key = private_key.public_key() + ct = pytest.deprecated_call( + backend.encrypt_rsa, + public_key, + b"\x00" * 32, + padding.PKCS1v15() + ) + pytest.deprecated_call( + backend.decrypt_rsa, + private_key, + ct, + padding.PKCS1v15() + ) |