From 6b2bcefbacb44b4081a811af4ae429934cf631f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Thu, 13 Aug 2026 09:14:41 +0300 Subject: [PATCH] decode_cla: label standard ETSI class bytes precisely CLA 0x80 is the ETSI/3GPP-defined UICC/USIM class (TS 102 221 Table 10.3), not ISO 7816-4 'proprietary'. Relabel 0x80 -> ETSI-defined (UICC/USIM), 0xA0 -> ETSI-defined (SIM/GSM), 0x00 -> inter-industry (ISO 7816-4); drop the now-redundant note field. --- simtrace2_pysniff/server/decode.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/simtrace2_pysniff/server/decode.py b/simtrace2_pysniff/server/decode.py index 55a78e4..0585826 100644 --- a/simtrace2_pysniff/server/decode.py +++ b/simtrace2_pysniff/server/decode.py @@ -103,12 +103,14 @@ def decode_sw(raw_sw): def decode_cla(cla): chain_bits = (cla >> 4) & 0x03 chain_names = {0: 'last or only', 1: 'first in chain', 2: 'not last in chain', 3: 'not last'} - interclass = 'inter-industry' if (cla & 0x80) == 0 else 'proprietary' - note = None - if cla in (0xa0, 0x80): - note = 'standard UICC CLA' + if cla == 0x80: + interclass = 'ETSI-defined (UICC/USIM)' + elif cla == 0xa0: + interclass = 'ETSI-defined (SIM/GSM)' elif cla == 0x00: - note = 'standard inter-industry CLA' + interclass = 'inter-industry (ISO 7816-4)' + else: + interclass = 'inter-industry' if (cla & 0x80) == 0 else 'proprietary' result = { 'hex': f'{cla:02x}', 'interclass': interclass, @@ -116,8 +118,6 @@ def decode_cla(cla): 'secure_messaging': 'none' if (cla & 0x0c) == 0 else 'SM present', 'chain': chain_names.get(chain_bits, f'unknown ({chain_bits})'), } - if note: - result['note'] = note return result