diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-29 17:17:44 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-01-29 17:17:44 -0600 |
commit | e0608db24e4744fd0aeb83a52d173e66989cd54c (patch) | |
tree | db5d5d56aec57f3a332a600c94297e3ca43a0c16 | |
parent | b2ff87737ca27a171ce0034e100841782d19dd7b (diff) | |
download | cryptography-e0608db24e4744fd0aeb83a52d173e66989cd54c.tar.gz cryptography-e0608db24e4744fd0aeb83a52d173e66989cd54c.tar.bz2 cryptography-e0608db24e4744fd0aeb83a52d173e66989cd54c.zip |
simplify hmac supported and hash supported calls for commoncrypto
-rw-r--r-- | cryptography/hazmat/backends/commoncrypto/backend.py | 14 |
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) |