diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-29 17:16:27 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-29 17:16:27 -0600 |
commit | 84fc58c1d03e6512c203ba19439cebc17fd393a7 (patch) | |
tree | 24a18faa0e3f2b789a7e47ec693a61ddc72b656a | |
parent | 0216d60e083bac29b8a8b699ea1c1eb1002b58e9 (diff) | |
download | cryptography-84fc58c1d03e6512c203ba19439cebc17fd393a7.tar.gz cryptography-84fc58c1d03e6512c203ba19439cebc17fd393a7.tar.bz2 cryptography-84fc58c1d03e6512c203ba19439cebc17fd393a7.zip |
simplify check for algorithm
-rw-r--r-- | cryptography/hazmat/backends/commoncrypto/backend.py | 7 |
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): |