diff options
-rw-r--r-- | cryptography/hazmat/backends/multibackend.py | 3 | ||||
-rw-r--r-- | tests/hazmat/backends/test_multibackend.py | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/cryptography/hazmat/backends/multibackend.py b/cryptography/hazmat/backends/multibackend.py index 24a7a357..981a60bd 100644 --- a/cryptography/hazmat/backends/multibackend.py +++ b/cryptography/hazmat/backends/multibackend.py @@ -170,4 +170,5 @@ class MultiBackend(object): return b.create_cmac_ctx(algorithm) except UnsupportedAlgorithm: pass - raise UnsupportedAlgorithm("This backend does not support CMAC") + raise UnsupportedAlgorithm("This backend does not support CMAC", + _Reasons.UNSUPPORTED_CIPHER) diff --git a/tests/hazmat/backends/test_multibackend.py b/tests/hazmat/backends/test_multibackend.py index 2fa9f758..d8c09bd7 100644 --- a/tests/hazmat/backends/test_multibackend.py +++ b/tests/hazmat/backends/test_multibackend.py @@ -13,8 +13,6 @@ from __future__ import absolute_import, division, print_function -import pytest - from cryptography import utils from cryptography.exceptions import ( UnsupportedAlgorithm, _Reasons @@ -120,7 +118,7 @@ class DummyCMACBackend(object): def create_cmac_ctx(self, algorithm): if not self.cmac_algorithm_supported(algorithm): - raise UnsupportedAlgorithm("") + raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_CIPHER) class TestMultiBackend(object): @@ -252,5 +250,5 @@ class TestMultiBackend(object): cmac.CMAC(algorithms.AES(fake_key), backend) - with pytest.raises(UnsupportedAlgorithm): + with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cmac.CMAC(algorithms.TripleDES(fake_key), backend) |