aboutsummaryrefslogtreecommitdiffstats
path: root/cryptography
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2013-11-22 16:54:55 -0800
committerAlex Gaynor <alex.gaynor@gmail.com>2013-11-22 16:54:55 -0800
commitbae899ad36bcb99dbec94aaf026ef1650f2b1242 (patch)
treee81941130005701cee0139d57f53b817224fefd2 /cryptography
parente247d0be584c52e25694918ad2345dadde3fefa9 (diff)
downloadcryptography-bae899ad36bcb99dbec94aaf026ef1650f2b1242.tar.gz
cryptography-bae899ad36bcb99dbec94aaf026ef1650f2b1242.tar.bz2
cryptography-bae899ad36bcb99dbec94aaf026ef1650f2b1242.zip
Change teh exception
Diffstat (limited to 'cryptography')
-rw-r--r--cryptography/exceptions.py4
-rw-r--r--cryptography/hazmat/bindings/openssl/backend.py6
2 files changed, 3 insertions, 7 deletions
diff --git a/cryptography/exceptions.py b/cryptography/exceptions.py
index a39674f9..c2e71493 100644
--- a/cryptography/exceptions.py
+++ b/cryptography/exceptions.py
@@ -18,7 +18,3 @@ class UnsupportedAlgorithm(Exception):
class AlreadyFinalized(Exception):
pass
-
-
-class IncorrectPadding(Exception):
- pass
diff --git a/cryptography/hazmat/bindings/openssl/backend.py b/cryptography/hazmat/bindings/openssl/backend.py
index 77ecf277..b2599d22 100644
--- a/cryptography/hazmat/bindings/openssl/backend.py
+++ b/cryptography/hazmat/bindings/openssl/backend.py
@@ -19,7 +19,7 @@ import sys
import cffi
from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm, IncorrectPadding
+from cryptography.exceptions import UnsupportedAlgorithm
from cryptography.hazmat.bindings.interfaces import (
CipherBackend, HashBackend, HMACBackend
)
@@ -205,10 +205,10 @@ 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 IncorrectPadding
+ raise ValueError
elif func == self.lib.EVP_F_EVP_DECRYPTFINAL_EX:
if reason == self.lib.EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH:
- raise IncorrectPadding
+ raise ValueError
raise SystemError(
"Unknown error code from OpenSSL, you should probably file a bug."