diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-12-22 07:45:32 -0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-12-22 07:45:32 -0800 |
commit | d5c351e217b8c55034a5161d6f231d5810f7f2ad (patch) | |
tree | 4af2ecee820ae8e11ef4ce38d8c01bb85ae9ce1a /cryptography | |
parent | c09f6aa5f14d8d544b3441e442b43427c2e0d93f (diff) | |
parent | 35cb3659bcf97eea22ce1ad14b7fc3d0913d2be2 (diff) | |
download | cryptography-d5c351e217b8c55034a5161d6f231d5810f7f2ad.tar.gz cryptography-d5c351e217b8c55034a5161d6f231d5810f7f2ad.tar.bz2 cryptography-d5c351e217b8c55034a5161d6f231d5810f7f2ad.zip |
Merge pull request #325 from public/unsupported-cipher-messages
UnsupportedAlgorithm error messages for Ciphers
Diffstat (limited to 'cryptography')
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index bd3eee20..080cb5f1 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -288,11 +288,19 @@ class _CipherContext(object): try: adapter = registry[type(cipher), type(mode)] except KeyError: - raise UnsupportedAlgorithm + raise UnsupportedAlgorithm( + "cipher {0} in {1} mode is not supported " + "by this backend".format( + cipher.name, mode.name if mode else mode) + ) evp_cipher = adapter(self._backend, cipher, mode) if evp_cipher == self._backend.ffi.NULL: - raise UnsupportedAlgorithm + raise UnsupportedAlgorithm( + "cipher {0} in {1} mode is not supported " + "by this backend".format( + cipher.name, mode.name if mode else mode) + ) if isinstance(mode, interfaces.ModeWithInitializationVector): iv_nonce = mode.initialization_vector |