aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography/hazmat
diff options
context:
space:
mode:
Diffstat (limited to 'cryptography/hazmat')
-rw-r--r--cryptography/hazmat/backends/openssl/backend.py8
1 files changed, 4 insertions, 4 deletions
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]