laforge submitted this change.
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
---
M pySim/commands.py
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pySim/commands.py b/pySim/commands.py
index af9f247..dd58109 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -735,7 +735,7 @@
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
To view, visit change 39866. To unsubscribe, or for help writing mail filters, visit settings.