From f57f6a95a5fae4246c0a65bf92ced951e803df07 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 28 Mar 2025 08:58:55 +0100 Subject: [PATCH] pySim/commands: Fix envelope command APDU case after T=1 support When we merged I8b56d7804a2b4c392f43f8540e0b6e70001a8970 for T=1 support, the ENVELOPE C-APDU was not adjusted to reflect the correct case. ENVELOPE expects a response and hence needs a Le byte present. This avoids below related message when performing e.g. OTA via SMS Warning: received unexpected response data, incorrect APDU-case (3, should be 4, missing Le field?)! Change-Id: Ice12675e02aa5438cf9f069f8fcc296c64aabc5a Related: OS#6367 --- pySim/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pySim/commands.py b/pySim/commands.py index af9f2471..dd58109d 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -735,7 +735,7 @@ class SimCardCommands: Args: payload : payload as hex string """ - return self.send_apdu_checksw('80c20000%02x%s' % (len(payload)//2, payload), apply_lchan = False) + return self.send_apdu_checksw('80c20000%02x%s' % (len(payload)//2, payload) + "00", apply_lchan = False) def terminal_profile(self, payload: Hexstr) -> ResTuple: """Send TERMINAL PROFILE to card