diff options
author | Ayrx <terrycwk1994@gmail.com> | 2014-04-17 17:15:02 +0800 |
---|---|---|
committer | Ayrx <terrycwk1994@gmail.com> | 2014-04-22 12:12:41 +0800 |
commit | 78f6f333742883f334cb4ff859e6f0633babc242 (patch) | |
tree | b48c71d01e6611abf8c7df8a83dcf92494cb0130 /cryptography | |
parent | 2f2aa5f1647dac2ff8403e25deb38e7839bb2729 (diff) | |
download | cryptography-78f6f333742883f334cb4ff859e6f0633babc242.tar.gz cryptography-78f6f333742883f334cb4ff859e6f0633babc242.tar.bz2 cryptography-78f6f333742883f334cb4ff859e6f0633babc242.zip |
Updated tests
Diffstat (limited to 'cryptography')
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index 4054e56c..ae4b4a85 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -555,8 +555,9 @@ class Backend(object): return self._ffi.buffer(buf)[:res] - def cmac_supported(self): - return backend._lib.Cryptography_HAS_CMAC == 1 + def cmac_algorithm_supported(self, algorithm): + return backend._lib.Cryptography_HAS_CMAC == 1 \ + and backend.cipher_supported(algorithm, CBC(0)) def create_cmac_ctx(self, algorithm): return _CMACContext(self, algorithm) @@ -1251,7 +1252,7 @@ class _RSAVerificationContext(object): class _CMACContext(object): def __init__(self, backend, algorithm, ctx=None): - if not backend.cmac_supported(): + if not backend.cmac_algorithm_supported(algorithm): raise UnsupportedAlgorithm("This backend does not support CMAC") self._backend = backend |