diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/hazmat/backends/test_openssl.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py index ad2daf7d..98023e9d 100644 --- a/tests/hazmat/backends/test_openssl.py +++ b/tests/hazmat/backends/test_openssl.py @@ -456,6 +456,29 @@ class TestOpenSSLRSA(object): ) ) + def test_supported_oaep_decrypt(self): + private_key = RSA_KEY_512.private_key(backend) + + ciphertext = private_key.public_key().encrypt( + b'secure data', + padding.OAEP( + mgf=padding.MGF1(algorithm=hashes.SHA1()), + algorithm=hashes.SHA1(), + label=None + ) + ) + + decrypted = private_key.decrypt( + ciphertext, + padding.OAEP( + mgf=padding.MGF1(algorithm=hashes.SHA1()), + algorithm=hashes.SHA1(), + label=None + ) + ) + + assert decrypted == b'secure data' + @pytest.mark.skipif( backend._lib.OPENSSL_VERSION_NUMBER <= 0x10001000, |