aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cryptography/hazmat/backends/commoncrypto/backend.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/cryptography/hazmat/backends/commoncrypto/backend.py b/cryptography/hazmat/backends/commoncrypto/backend.py
index 4e70cab5..b612a805 100644
--- a/cryptography/hazmat/backends/commoncrypto/backend.py
+++ b/cryptography/hazmat/backends/commoncrypto/backend.py
@@ -90,20 +90,10 @@ class Backend(object):
}
def hash_supported(self, algorithm):
- try:
- self._hash_mapping[algorithm.name]
- except KeyError:
- return False
- else:
- return True
+ return algorithm.name in self._hash_mapping
def hmac_supported(self, algorithm):
- try:
- self._supported_hmac_algorithms[algorithm.name]
- except KeyError:
- return False
- else:
- return True
+ return algorithm.name in self._supported_hmac_algorithms
def create_hash_ctx(self, algorithm):
return _HashContext(self, algorithm)