aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/backends')
-rw-r--r--tests/hazmat/backends/test_commoncrypto.py1
-rw-r--r--tests/hazmat/backends/test_multibackend.py14
-rw-r--r--tests/hazmat/backends/test_openssl.py3
3 files changed, 11 insertions, 7 deletions
diff --git a/tests/hazmat/backends/test_commoncrypto.py b/tests/hazmat/backends/test_commoncrypto.py
index 28d1a6ca..b79c02e0 100644
--- a/tests/hazmat/backends/test_commoncrypto.py
+++ b/tests/hazmat/backends/test_commoncrypto.py
@@ -30,6 +30,7 @@ from ...utils import raises_unsupported_algorithm
class DummyCipher(object):
name = "dummy-cipher"
block_size = 128
+ key_size = 128
@pytest.mark.skipif("commoncrypto" not in
diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py
index c50b6cf6..39c03146 100644
--- a/tests/hazmat/backends/test_multibackend.py
+++ b/tests/hazmat/backends/test_multibackend.py
@@ -38,15 +38,15 @@ class DummyCipherBackend(object):
def __init__(self, supported_ciphers):
self._ciphers = supported_ciphers
- def cipher_supported(self, algorithm, mode):
- return (type(algorithm), type(mode)) in self._ciphers
+ def cipher_supported(self, cipher, mode):
+ return (type(cipher), type(mode)) in self._ciphers
- def create_symmetric_encryption_ctx(self, algorithm, mode):
- if not self.cipher_supported(algorithm, mode):
+ def create_symmetric_encryption_ctx(self, cipher, mode):
+ if not self.cipher_supported(cipher, mode):
raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_CIPHER)
- def create_symmetric_decryption_ctx(self, algorithm, mode):
- if not self.cipher_supported(algorithm, mode):
+ def create_symmetric_decryption_ctx(self, cipher, mode):
+ if not self.cipher_supported(cipher, mode):
raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_CIPHER)
@@ -92,7 +92,7 @@ class DummyPBKDF2HMACBackend(object):
@utils.register_interface(RSABackend)
class DummyRSABackend(object):
- def generate_rsa_private_key(self, public_exponent, private_key):
+ def generate_rsa_private_key(self, public_exponent, key_size):
pass
def rsa_padding_supported(self, padding):
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index 3bea413a..83494d0d 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -51,6 +51,7 @@ class DummyMode(object):
@utils.register_interface(interfaces.CipherAlgorithm)
class DummyCipher(object):
name = "dummy-cipher"
+ key_size = 128
@utils.register_interface(interfaces.AsymmetricPadding)
@@ -61,6 +62,8 @@ class DummyPadding(object):
@utils.register_interface(interfaces.HashAlgorithm)
class DummyHash(object):
name = "dummy-hash"
+ block_size = 128
+ digest_size = 128
class DummyMGF(object):