aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat')
-rw-r--r--tests/hazmat/backends/test_commoncrypto.py1
-rw-r--r--tests/hazmat/backends/test_openssl.py3
-rw-r--r--tests/hazmat/primitives/test_block.py1
-rw-r--r--tests/hazmat/primitives/test_ec.py11
-rw-r--r--tests/hazmat/primitives/test_hashes.py2
-rw-r--r--tests/hazmat/primitives/test_hmac.py2
-rw-r--r--tests/hazmat/primitives/test_pbkdf2hmac.py2
7 files changed, 21 insertions, 1 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_openssl.py b/tests/hazmat/backends/test_openssl.py
index 39708f82..65113f1a 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -52,6 +52,7 @@ class DummyMode(object):
@utils.register_interface(interfaces.CipherAlgorithm)
class DummyCipher(object):
name = "dummy-cipher"
+ key_size = 128
@utils.register_interface(interfaces.AsymmetricPadding)
@@ -62,6 +63,8 @@ class DummyPadding(object):
@utils.register_interface(interfaces.HashAlgorithm)
class DummyHash(object):
name = "dummy-hash"
+ block_size = 128
+ digest_size = 128
class DummyMGF(object):
diff --git a/tests/hazmat/primitives/test_block.py b/tests/hazmat/primitives/test_block.py
index 6ee230a7..53b87341 100644
--- a/tests/hazmat/primitives/test_block.py
+++ b/tests/hazmat/primitives/test_block.py
@@ -44,6 +44,7 @@ class DummyMode(object):
@utils.register_interface(interfaces.CipherAlgorithm)
class DummyCipher(object):
name = "dummy-cipher"
+ key_size = 128
@pytest.mark.requires_backend_interface(interface=CipherBackend)
diff --git a/tests/hazmat/primitives/test_ec.py b/tests/hazmat/primitives/test_ec.py
index decb3716..683df046 100644
--- a/tests/hazmat/primitives/test_ec.py
+++ b/tests/hazmat/primitives/test_ec.py
@@ -68,11 +68,20 @@ class DummyCurve(object):
@utils.register_interface(interfaces.EllipticCurveSignatureAlgorithm)
class DummySignatureAlgorithm(object):
- pass
+ algorithm = None
@utils.register_interface(EllipticCurveBackend)
class DeprecatedDummyECBackend(object):
+ def _unimplemented(self):
+ raise NotImplementedError
+
+ elliptic_curve_signature_algorithm_supported = _unimplemented
+ load_elliptic_curve_private_numbers = _unimplemented
+ load_elliptic_curve_public_numbers = _unimplemented
+ elliptic_curve_supported = _unimplemented
+ generate_elliptic_curve_private_key = _unimplemented
+
def elliptic_curve_private_key_from_numbers(self, numbers):
return b"private_key"
diff --git a/tests/hazmat/primitives/test_hashes.py b/tests/hazmat/primitives/test_hashes.py
index ba4f53af..79fc25c3 100644
--- a/tests/hazmat/primitives/test_hashes.py
+++ b/tests/hazmat/primitives/test_hashes.py
@@ -33,6 +33,8 @@ from ...utils import raises_unsupported_algorithm
@utils.register_interface(interfaces.HashAlgorithm)
class UnsupportedDummyHash(object):
name = "unsupported-dummy-hash"
+ block_size = 128
+ digest_size = 128
@pytest.mark.requires_backend_interface(interface=HashBackend)
diff --git a/tests/hazmat/primitives/test_hmac.py b/tests/hazmat/primitives/test_hmac.py
index baf8a299..01b1cdcb 100644
--- a/tests/hazmat/primitives/test_hmac.py
+++ b/tests/hazmat/primitives/test_hmac.py
@@ -33,6 +33,8 @@ from ...utils import raises_unsupported_algorithm
@utils.register_interface(interfaces.HashAlgorithm)
class UnsupportedDummyHash(object):
name = "unsupported-dummy-hash"
+ block_size = 128
+ digest_size = 128
@pytest.mark.supported(
diff --git a/tests/hazmat/primitives/test_pbkdf2hmac.py b/tests/hazmat/primitives/test_pbkdf2hmac.py
index e928fc6a..fa925877 100644
--- a/tests/hazmat/primitives/test_pbkdf2hmac.py
+++ b/tests/hazmat/primitives/test_pbkdf2hmac.py
@@ -31,6 +31,8 @@ from ...utils import raises_unsupported_algorithm
@utils.register_interface(interfaces.HashAlgorithm)
class DummyHash(object):
name = "dummy-hash"
+ block_size = 128
+ digest_size = 128
class TestPBKDF2HMAC(object):