diff options
author | Alex Stapleton <alexs@prol.etari.at> | 2013-12-21 16:29:45 +0000 |
---|---|---|
committer | Alex Stapleton <alexs@prol.etari.at> | 2013-12-22 10:48:01 +0000 |
commit | 35cb3659bcf97eea22ce1ad14b7fc3d0913d2be2 (patch) | |
tree | 925805d60b56e0be6da8777de550c73c25f97d65 /cryptography | |
parent | 9b9318d79ba5927603b120411d13b607938cae56 (diff) | |
download | cryptography-35cb3659bcf97eea22ce1ad14b7fc3d0913d2be2.tar.gz cryptography-35cb3659bcf97eea22ce1ad14b7fc3d0913d2be2.tar.bz2 cryptography-35cb3659bcf97eea22ce1ad14b7fc3d0913d2be2.zip |
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 588a4273..714823e9 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 |