diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-03 11:29:15 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-11-03 11:29:15 -0800 |
commit | 0857c3f03e2784cac9e2a35f5579e9c4c8dc824a (patch) | |
tree | 0c35ab424fabdefe73bad4fea70edddc7fea1509 /cryptography | |
parent | d4e98f8d552843c371600c88e1cdab94678081a9 (diff) | |
download | cryptography-0857c3f03e2784cac9e2a35f5579e9c4c8dc824a.tar.gz cryptography-0857c3f03e2784cac9e2a35f5579e9c4c8dc824a.tar.bz2 cryptography-0857c3f03e2784cac9e2a35f5579e9c4c8dc824a.zip |
Replaced an assertion in the OpenSSL backend with a proper exception
Diffstat (limited to 'cryptography')
-rw-r--r-- | cryptography/hazmat/bindings/openssl/backend.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cryptography/hazmat/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py index 32adfed9..b610caa2 100644 --- a/cryptography/hazmat/bindings/openssl/backend.py +++ b/cryptography/hazmat/bindings/openssl/backend.py @@ -135,7 +135,9 @@ class _CipherContext(object): raise UnsupportedAlgorithm evp_cipher = adapter(self._backend, cipher, mode) - assert evp_cipher != self._backend.ffi.NULL + if evp_cipher == self._backend.ffi.NULL: + raise UnsupportedAlgorithm + if isinstance(mode, interfaces.ModeWithInitializationVector): iv_nonce = mode.initialization_vector elif isinstance(mode, interfaces.ModeWithNonce): |