small fix for aes_cbc_decrypt_text

This commit is contained in:
Mike Fährmann
2017-06-30 15:21:04 +02:00
parent 21064146c1
commit 4414aefe97
2 changed files with 2 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ def aes_cbc_decrypt_text(data, key, iv):
data = base64.standard_b64decode(bytes(data, "ascii"))
charcodes = aes_cbc_decrypt(list(data), key, iv)
last = charcodes[-1]
if last < 16:
if last <= 16:
charcodes = charcodes[:-last]
return bytes(charcodes).decode()