aboutsummaryrefslogtreecommitdiffstats
path: root/tests/hazmat/backends/test_commoncrypto.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/hazmat/backends/test_commoncrypto.py')
-rw-r--r--tests/hazmat/backends/test_commoncrypto.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/tests/hazmat/backends/test_commoncrypto.py b/tests/hazmat/backends/test_commoncrypto.py
index f7200016..2b730e93 100644
--- a/tests/hazmat/backends/test_commoncrypto.py
+++ b/tests/hazmat/backends/test_commoncrypto.py
@@ -6,23 +6,16 @@ from __future__ import absolute_import, division, print_function
import pytest
-from cryptography import utils
from cryptography.exceptions import InternalError, _Reasons
from cryptography.hazmat.backends import _available_backends
-from cryptography.hazmat.primitives.ciphers import Cipher, CipherAlgorithm
+from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.hazmat.primitives.ciphers.modes import CBC, GCM
+from ...doubles import DummyCipherAlgorithm
from ...utils import raises_unsupported_algorithm
-@utils.register_interface(CipherAlgorithm)
-class DummyCipher(object):
- name = "dummy-cipher"
- block_size = None
- key_size = None
-
-
@pytest.mark.skipif("commoncrypto" not in
[i.name for i in _available_backends()],
reason="CommonCrypto not available")
@@ -55,7 +48,7 @@ class TestCommonCrypto(object):
from cryptography.hazmat.backends.commoncrypto.backend import Backend
b = Backend()
cipher = Cipher(
- DummyCipher(), GCM(b"fake_iv_here"), backend=b,
+ DummyCipherAlgorithm(), GCM(b"fake_iv_here"), backend=b,
)
with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER):
cipher.encryptor()