shadysim.py: use string multiplication to add padding
This commit is contained in:
parent
caa2a1752e
commit
8ac76661ce
|
@ -115,9 +115,7 @@ class AppLoaderCommands(object):
|
|||
if ((spi_1 & 0x04) != 0): # check ciphering bit
|
||||
len_cipher = 6 + len_sig + (len(data) / 2)
|
||||
pad_cnt = 8 - (len_cipher % 8) # 8 Byte blocksize for DES-CBC (TODO: different padding)
|
||||
# TODO: there is probably a better way to add "pad_cnt" padding bytes
|
||||
for i in range(0, pad_cnt):
|
||||
data = data + '00';
|
||||
data += '00' * pad_cnt
|
||||
|
||||
# CHL + SPI first octet
|
||||
part_head = ('%02x' % (0x0D + len_sig)) + ('%02x' % (spi_1))
|
||||
|
|
Loading…
Reference in New Issue