From 1a9cabbbf008ad919294d815ade3e44cb96c441d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 9 Jun 2024 16:15:28 +0200 Subject: [PATCH] pySim/ota: Don't modify input argument in OtaDialectSms.encode_cmd Change-Id: I4c4c44002762696b931ed3580ffe54daf62ffa61 --- pySim/ota.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pySim/ota.py b/pySim/ota.py index 10de6116..54e8f75f 100644 --- a/pySim/ota.py +++ b/pySim/ota.py @@ -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}