From 84fc58c1d03e6512c203ba19439cebc17fd393a7 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 29 Jan 2014 17:16:27 -0600 Subject: simplify check for algorithm --- cryptography/hazmat/backends/commoncrypto/backend.py | 7 +------ 1 file changed, 1 insertion(+), 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): -- cgit v1.2.3