summaryrefslogtreecommitdiff
path: root/lib/Crypto/Signature/PKCS1_v1_5.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Crypto/Signature/PKCS1_v1_5.py')
-rw-r--r--lib/Crypto/Signature/PKCS1_v1_5.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Crypto/Signature/PKCS1_v1_5.py b/lib/Crypto/Signature/PKCS1_v1_5.py
index 4ea1224..6a2e0d0 100644
--- a/lib/Crypto/Signature/PKCS1_v1_5.py
+++ b/lib/Crypto/Signature/PKCS1_v1_5.py
@@ -238,7 +238,7 @@ def EMSA_PKCS1_V1_5_ENCODE(hash, emLen, with_hash_parameters=True):
# We need at least 11 bytes for the remaining data: 3 fixed bytes and
# at least 8 bytes of padding).
if emLen<len(digestInfo)+11:
- raise ValueError("Selected hash algorith has a too long digest (%d bytes)." % len(digest))
+ raise TypeError("Selected hash algorith has a too long digest (%d bytes)." % len(digest))
PS = bchr(0xFF) * (emLen - len(digestInfo) - 3)
return b("\x00\x01") + PS + bchr(0x00) + digestInfo