From f22637f151d2c4f7869614c591c885b3a688b571 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 8 Jun 2024 17:28:01 +0200 Subject: [PATCH] pySim.apdu.ts_102_221: Decode the ENVELOPE command body using pySim.cat TLV This will decode the ENVELOPE body in pySim-trace further. Before: 00 ENVELOPE - 9000 {'p1': 0, 'p2': 0, 'cmd': 'd14682028381060291978b3c40048111227ff6407070611535002d02700000281516011212000001eae1bd578fa25791898128811b2206cc71639ca292ec2526da8aef4273d2fe2e', 'rsp': '027100001f0a00000100000001200000ab12800101230d08a0000001510000000f829000'} After: 00 ENVELOPE - 9000 {'p1': 0, 'p2': 0, 'cmd': [{'smspp_download': [{'device_identities': {'source_dev_id': 'network', 'dest_dev_id': 'uicc'}}, {'address': {'ton_npi': 145, 'call_number': '79'}}, {'sms_tpdu': {'tpdu': '40048111227ff6407070611535002d02700000281516011212000001eae1bd578fa25791898128811b2206cc71639ca292ec2526da8aef4273d2fe2e'}}]}], 'rsp': '027100001f0a00000100000001200000ab12800101230d08a0000001510000000f829000'} Change-Id: I5ecdbe0b5fa8856cb723569896b73cd49778ed5f --- pySim/apdu/ts_102_221.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py index 52d88d29..5636da22 100644 --- a/pySim/apdu/ts_102_221.py +++ b/pySim/apdu/ts_102_221.py @@ -1,7 +1,7 @@ # coding=utf-8 """APDU definitions/decoders of ETSI TS 102 221, the core UICC spec. -(C) 2022 by Harald Welte +(C) 2022-2024 by Harald Welte This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ from pySim.filesystem import * from pySim.runtime import RuntimeLchan from pySim.apdu import ApduCommand, ApduCommandSet from pySim.utils import i2h +from pySim import cat logger = logging.getLogger(__name__) @@ -458,6 +459,7 @@ class TerminalProfile(ApduCommand, n='TERMINAL PROFILE', ins=0x10, cla=['80']): # TS 102 221 Section 11.2.2 / TS 102 223 class Envelope(ApduCommand, n='ENVELOPE', ins=0xC2, cla=['80']): _apdu_case = 4 + _tlv = cat.EventCollection # TS 102 221 Section 11.2.3 / TS 102 223 class Fetch(ApduCommand, n='FETCH', ins=0x12, cla=['80']):