diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-19 09:34:56 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2014-04-20 16:53:04 -0500 |
commit | 8ab7a360330daa195ea1c0cf70d606dc7dce88c8 (patch) | |
tree | 4800e1b4b3c4d03bc0dfb7d4560e5d5576262a2f /cryptography | |
parent | 73dd4d5bd713f80fc0ffe04921d61d993437d458 (diff) | |
download | cryptography-8ab7a360330daa195ea1c0cf70d606dc7dce88c8.tar.gz cryptography-8ab7a360330daa195ea1c0cf70d606dc7dce88c8.tar.bz2 cryptography-8ab7a360330daa195ea1c0cf70d606dc7dce88c8.zip |
remove InvalidDecryption and replace with ValueError
Diffstat (limited to 'cryptography')
-rw-r--r-- | cryptography/exceptions.py | 4 | ||||
-rw-r--r-- | cryptography/hazmat/backends/openssl/backend.py | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/cryptography/exceptions.py b/cryptography/exceptions.py index fe9bf840..b4ee8feb 100644 --- a/cryptography/exceptions.py +++ b/cryptography/exceptions.py @@ -59,7 +59,3 @@ class InvalidKey(Exception): class InvalidToken(Exception): pass - - -class InvalidDecryption(Exception): - pass diff --git a/cryptography/hazmat/backends/openssl/backend.py b/cryptography/hazmat/backends/openssl/backend.py index d7f32cd3..5e13bfc1 100644 --- a/cryptography/hazmat/backends/openssl/backend.py +++ b/cryptography/hazmat/backends/openssl/backend.py @@ -21,8 +21,8 @@ import six from cryptography import utils from cryptography.exceptions import ( - AlreadyFinalized, InternalError, InvalidDecryption, InvalidSignature, - InvalidTag, UnsupportedAlgorithm, _Reasons + AlreadyFinalized, InternalError, InvalidSignature, InvalidTag, + UnsupportedAlgorithm, _Reasons ) from cryptography.hazmat.backends.interfaces import ( CipherBackend, DSABackend, HMACBackend, HashBackend, PBKDF2HMACBackend, @@ -525,7 +525,7 @@ class Backend(object): errors[0].reason == self._lib.RSA_R_BLOCK_TYPE_IS_NOT_01 or errors[0].reason == self._lib.RSA_R_BLOCK_TYPE_IS_NOT_02 ) - raise InvalidDecryption + raise ValueError("Decryption failed") return self._ffi.buffer(buf)[:outlen[0]] @@ -550,7 +550,7 @@ class Backend(object): errors[0].reason == self._lib.RSA_R_BLOCK_TYPE_IS_NOT_01 or errors[0].reason == self._lib.RSA_R_BLOCK_TYPE_IS_NOT_02 ) - raise InvalidDecryption + raise ValueError("Decryption failed") return self._ffi.buffer(buf)[:res] |