Skip to content

Commit 5a90c26

Browse files
author
phyber
committed
Format bad pad length with .format
1 parent 5ad3749 commit 5a90c26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tibudecrypt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def pkcs5_unpad(chunk):
6262

6363
# Cite https://stackoverflow.com/a/20457519
6464
if padding_length < 1 or padding_length > Crypto.Cipher.AES.block_size:
65-
raise ValueError("bad decrypt pad (%d)" % padding_length)
65+
raise ValueError("bad decrypt pad ({padding_length:d})".format(
66+
padding_length=padding_length))
6667

6768
# all the pad-bytes must be the same
6869
expected_bytes = chr(padding_length).encode('ascii') * padding_length

0 commit comments

Comments
 (0)