pySim/ota: Don't modify input argument in OtaDialectSms.encode_cmd

Change-Id: I4c4c44002762696b931ed3580ffe54daf62ffa61
This commit is contained in:
Harald Welte
2024-06-09 16:15:28 +02:00
parent 4a191089dc
commit 1a9cabbbf0

View File

@@ -332,6 +332,7 @@ class OtaDialectSms(OtaDialect):
len_cipher = 6 + len_sig + len(apdu)
padding = otak.crypt._get_padding(len_cipher, otak.crypt.blocksize)
pad_cnt = len(padding)
apdu = bytes(apdu) # make a copy so we don't modify the input data
apdu += padding
kic = {'key': otak.kic_idx, 'algo': otak.algo_crypt}