diff options
-rw-r--r-- | cryptography/hazmat/bindings/openssl/backend.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cryptography/hazmat/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py index 86c6f660..235a8e30 100644 --- a/cryptography/hazmat/bindings/openssl/backend.py +++ b/cryptography/hazmat/bindings/openssl/backend.py @@ -318,9 +318,10 @@ class Hashes(object): self._backend = backend def supported(self, algorithm): - return (self._backend.ffi.NULL != - self._backend.lib.EVP_get_digestbyname( - algorithm.name.encode("ascii"))) + digest = self._backend.lib.EVP_get_digestbyname( + algorithm.name.encode("ascii") + ) + return digest != self._backend.ffi.NULL def create_ctx(self, algorithm): return _HashContext(self._backend, algorithm) |