aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography/hazmat/bindings/openssl/backend.py
diff options
context:
space:
mode:
Diffstat (limited to 'cryptography/hazmat/bindings/openssl/backend.py')
-rw-r--r--cryptography/hazmat/bindings/openssl/backend.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/cryptography/hazmat/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py
index b2599d22..9f8ea939 100644
--- a/cryptography/hazmat/bindings/openssl/backend.py
+++ b/cryptography/hazmat/bindings/openssl/backend.py
@@ -205,10 +205,16 @@ class Backend(object):
if lib == self.lib.ERR_LIB_EVP:
if func == self.lib.EVP_F_EVP_ENCRYPTFINAL_EX:
if reason == self.lib.EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH:
- raise ValueError
+ raise ValueError(
+ "The length of the provided data is not a multiple of "
+ "the block length"
+ )
elif func == self.lib.EVP_F_EVP_DECRYPTFINAL_EX:
if reason == self.lib.EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH:
- raise ValueError
+ raise ValueError(
+ "The length of the provided data is not a multiple of "
+ "the block length"
+ )
raise SystemError(
"Unknown error code from OpenSSL, you should probably file a bug."