aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/primitives/test_rsa.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-10-23 11:01:25 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-10-23 11:01:25 -0700
commit7aab8b4ae4f5ab1710a985551c4105d608f5b852 (patch)
treefc0e9096c155374259b88f3d3404083f992e8836 /tests/hazmat/primitives/test_rsa.py
parenta05af52d1f0fba90030b62185d38523119d68b42 (diff)
downloadcryptography-7aab8b4ae4f5ab1710a985551c4105d608f5b852.tar.gz
cryptography-7aab8b4ae4f5ab1710a985551c4105d608f5b852.tar.bz2
cryptography-7aab8b4ae4f5ab1710a985551c4105d608f5b852.zip
Change how we represented that a test requires a backend.
This way is more extensible and requires less maintaince
Diffstat (limited to 'tests/hazmat/primitives/test_rsa.py')
-rw-r--r--tests/hazmat/primitives/test_rsa.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/hazmat/primitives/test_rsa.py b/tests/hazmat/primitives/test_rsa.py
index d1583e25..c3551e2b 100644
--- a/tests/hazmat/primitives/test_rsa.py
+++ b/tests/hazmat/primitives/test_rsa.py
@@ -25,6 +25,7 @@ from cryptography import utils
from cryptography.exceptions import (
AlreadyFinalized, InvalidSignature, _Reasons
)
+from cryptography.hazmat.backends.interfaces import RSABackend
from cryptography.hazmat.primitives import hashes, interfaces
from cryptography.hazmat.primitives.asymmetric import padding, rsa
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicNumbers
@@ -85,7 +86,7 @@ def test_modular_inverse():
)
-@pytest.mark.rsa
+@pytest.mark.requires_backend_interface(interface=RSABackend)
class TestRSA(object):
@pytest.mark.parametrize(
("public_exponent", "key_size"),
@@ -170,7 +171,7 @@ def test_rsa_generate_invalid_backend():
rsa.generate_private_key(65537, 2048, pretend_backend)
-@pytest.mark.rsa
+@pytest.mark.requires_backend_interface(interface=RSABackend)
class TestRSASignature(object):
@pytest.mark.supported(
only_if=lambda backend: backend.rsa_padding_supported(
@@ -436,7 +437,7 @@ class TestRSASignature(object):
signer.finalize()
-@pytest.mark.rsa
+@pytest.mark.requires_backend_interface(interface=RSABackend)
class TestRSAVerification(object):
@pytest.mark.supported(
only_if=lambda backend: backend.rsa_padding_supported(
@@ -772,7 +773,7 @@ class TestRSAVerification(object):
verifier.verify()
-@pytest.mark.rsa
+@pytest.mark.requires_backend_interface(interface=RSABackend)
class TestRSAPSSMGF1Verification(object):
test_rsa_pss_mgf1_sha1 = pytest.mark.supported(
only_if=lambda backend: backend.rsa_padding_supported(
@@ -900,7 +901,7 @@ class TestRSAPSSMGF1Verification(object):
))
-@pytest.mark.rsa
+@pytest.mark.requires_backend_interface(interface=RSABackend)
class TestRSAPKCS1Verification(object):
test_rsa_pkcs1v15_verify_sha1 = pytest.mark.supported(
only_if=lambda backend: (
@@ -1050,7 +1051,7 @@ class TestOAEP(object):
)
-@pytest.mark.rsa
+@pytest.mark.requires_backend_interface(interface=RSABackend)
class TestRSADecryption(object):
@pytest.mark.supported(
only_if=lambda backend: backend.rsa_padding_supported(
@@ -1191,7 +1192,7 @@ class TestRSADecryption(object):
)
-@pytest.mark.rsa
+@pytest.mark.requires_backend_interface(interface=RSABackend)
class TestRSAEncryption(object):
@pytest.mark.supported(
only_if=lambda backend: backend.rsa_padding_supported(
@@ -1310,7 +1311,7 @@ class TestRSAEncryption(object):
)
-@pytest.mark.rsa
+@pytest.mark.requires_backend_interface(interface=RSABackend)
class TestRSANumbers(object):
def test_rsa_public_numbers(self):
public_numbers = rsa.RSAPublicNumbers(e=1, n=15)