aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-10-25 18:11:46 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-10-25 18:11:46 -0700
commit198bb65302f710957a5f67d53389277c5ab0a58c (patch)
tree575cba23f0241cf73bea35febb08bb54cd79cab0 /tests
parent71725db962e6498d63751db3d8048fa56bcb1252 (diff)
downloadcryptography-198bb65302f710957a5f67d53389277c5ab0a58c.tar.gz
cryptography-198bb65302f710957a5f67d53389277c5ab0a58c.tar.bz2
cryptography-198bb65302f710957a5f67d53389277c5ab0a58c.zip
satisfy the cmac tests as well
Diffstat (limited to 'tests')
-rw-r--r--tests/hazmat/primitives/test_cmac.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/hazmat/primitives/test_cmac.py b/tests/hazmat/primitives/test_cmac.py
index 49e2043e..d9619daa 100644
--- a/tests/hazmat/primitives/test_cmac.py
+++ b/tests/hazmat/primitives/test_cmac.py
@@ -21,10 +21,10 @@ import pytest
import six
-from cryptography import utils
from cryptography.exceptions import (
AlreadyFinalized, InvalidSignature, _Reasons
)
+from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.backends.interfaces import CMACBackend
from cryptography.hazmat.primitives.ciphers.algorithms import (
AES, ARC4, TripleDES
@@ -195,18 +195,14 @@ class TestCMAC(object):
def test_copy():
- @utils.register_interface(CMACBackend)
- class PretendBackend(object):
- pass
-
- pretend_backend = PretendBackend()
+ backend = default_backend()
copied_ctx = pretend.stub()
pretend_ctx = pretend.stub(copy=lambda: copied_ctx)
key = b"2b7e151628aed2a6abf7158809cf4f3c"
- cmac = CMAC(AES(key), backend=pretend_backend, ctx=pretend_ctx)
+ cmac = CMAC(AES(key), backend=backend, ctx=pretend_ctx)
- assert cmac._backend is pretend_backend
- assert cmac.copy()._backend is pretend_backend
+ assert cmac._backend is backend
+ assert cmac.copy()._backend is backend
def test_invalid_backend():