aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-29 17:16:27 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-01-29 17:16:27 -0600
commit84fc58c1d03e6512c203ba19439cebc17fd393a7 (patch)
tree24a18faa0e3f2b789a7e47ec693a61ddc72b656a
parent0216d60e083bac29b8a8b699ea1c1eb1002b58e9 (diff)
downloadcryptography-84fc58c1d03e6512c203ba19439cebc17fd393a7.tar.gz
cryptography-84fc58c1d03e6512c203ba19439cebc17fd393a7.tar.bz2
cryptography-84fc58c1d03e6512c203ba19439cebc17fd393a7.zip
simplify check for algorithm
-rw-r--r--cryptography/hazmat/backends/commoncrypto/backend.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/cryptography/hazmat/backends/commoncrypto/backend.py b/cryptography/hazmat/backends/commoncrypto/backend.py
index ce40bb38..8792c8ac 100644
--- a/cryptography/hazmat/backends/commoncrypto/backend.py
+++ b/cryptography/hazmat/backends/commoncrypto/backend.py
@@ -144,12 +144,7 @@ class Backend(object):
return _CipherContext(self, cipher, mode, self._lib.kCCDecrypt)
def pbkdf2_hmac_supported(self, algorithm):
- try:
- self._supported_pbkdf2_hmac_algorithms[algorithm.name]
- except KeyError:
- return False
- else:
- return True
+ return algorithm.name in self._supported_pbkdf2_hmac_algorithms
def derive_pbkdf2_hmac(self, algorithm, length, salt, iterations,
key_material):