From f2fb02a2c42395d5b3b0f161a127234452a2a976 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 19 Jun 2014 10:16:42 -0600 Subject: deprecate old RSA classes and methods --- tests/hazmat/backends/test_openssl.py | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'tests/hazmat/backends/test_openssl.py') 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() + ) -- cgit v1.2.3