aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'okupy/common/crypto.py')
-rw-r--r--okupy/common/crypto.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/okupy/common/crypto.py b/okupy/common/crypto.py
index 705f173..a50d3b6 100644
--- a/okupy/common/crypto.py
+++ b/okupy/common/crypto.py
@@ -50,6 +50,8 @@ class OkupyCipher(object):
Decrypt the data block of given length. Removes padding if any.
"""
+ if len(data) < length:
+ raise ValueError('Ciphertext too short for requested length')
return self.cipher.decrypt(data)[:length]