diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2014-06-20 11:14:11 +0100 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2014-06-20 11:14:11 +0100 |
commit | 3f2b65cdf1cc3ef037bbca59aa8a9060e411831d (patch) | |
tree | 2d1fa3be4e526659caf939081147034073dcc195 /tests/hazmat/backends/test_openssl.py | |
parent | e3a5e67fef86758d03308695e3a4da1b444cac8c (diff) | |
parent | f2fb02a2c42395d5b3b0f161a127234452a2a976 (diff) | |
download | cryptography-3f2b65cdf1cc3ef037bbca59aa8a9060e411831d.tar.gz cryptography-3f2b65cdf1cc3ef037bbca59aa8a9060e411831d.tar.bz2 cryptography-3f2b65cdf1cc3ef037bbca59aa8a9060e411831d.zip |
Merge pull request #1124 from reaperhulk/rsa-numbers-deprecate
RSA Deprecation
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() + ) |