diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-05-25 20:43:21 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-05-25 20:43:21 -0500 |
commit | b8276c00e1b774088852e1bfc27c5af60588a6fd (patch) | |
tree | 529753522a75ce6a17012ed8dc02d5a65a25fe10 /tests/hazmat/primitives | |
parent | bf308598c2a588f67963decb69f09a2f5b8b7070 (diff) | |
download | cryptography-b8276c00e1b774088852e1bfc27c5af60588a6fd.tar.gz cryptography-b8276c00e1b774088852e1bfc27c5af60588a6fd.tar.bz2 cryptography-b8276c00e1b774088852e1bfc27c5af60588a6fd.zip |
add a few more RSA supported checks
Diffstat (limited to 'tests/hazmat/primitives')
-rw-r--r-- | tests/hazmat/primitives/test_rsa.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py index 4d5292e5..42e7b78f 100644 --- a/tests/hazmat/primitives/test_rsa.py +++ b/tests/hazmat/primitives/test_rsa.py @@ -553,7 +553,15 @@ class TestRSASignature(object): verifier.verify() @pytest.mark.supported( - only_if=lambda backend: backend.hash_supported(hashes.SHA512()), + only_if=lambda backend: ( + backend.hash_supported(hashes.SHA512()) and + backend.rsa_padding_supported( + padding.PSS( + mgf=padding.MGF1(hashes.SHA1()), + salt_length=padding.PSS.MAX_LENGTH + ) + ) + ), skip_message="Does not support SHA512." ) def test_pss_minimum_key_size_for_digest(self, backend): @@ -675,6 +683,12 @@ class TestRSASignature(object): private_key.signer( padding.PKCS1v15(), hashes.SHA256, pretend_backend) + @pytest.mark.supported( + only_if=lambda backend: backend.rsa_padding_supported( + padding.PSS(mgf=padding.MGF1(hashes.SHA1()), salt_length=0) + ), + skip_message="Does not support PSS." + ) def test_unsupported_pss_mgf(self, backend): private_key = rsa.RSAPrivateKey.generate( public_exponent=65537, @@ -1018,6 +1032,12 @@ class TestRSAVerification(object): public_key.verifier( b"foo", padding.PKCS1v15(), hashes.SHA256(), pretend_backend) + @pytest.mark.supported( + only_if=lambda backend: backend.rsa_padding_supported( + padding.PSS(mgf=padding.MGF1(hashes.SHA1()), salt_length=0) + ), + skip_message="Does not support PSS." + ) def test_unsupported_pss_mgf(self, backend): private_key = rsa.RSAPrivateKey.generate( public_exponent=65537, |