Extended logical channels: CLA 0-19, ATR card capabilities, MANAGE CHANNEL (v2.6.0)
- CLA decode (TS 102 221 §10.1.1/§10.3): standard channels 0-3 from b2-b1
and the extended channels 4-19 from b4-b1. The old further-format rule
read only b2-b1 (channel 8 read as 6, 19 as 7) and the ETSI '11x0 xxxx'
coding (0xC0-0xEF) was not handled at all; the class ranges now follow the
specs (0x80-0x8F UICC, 0xA0-0xAF SIM, 0xC0-0xEF ETSI extended, 0x20-0x3F
reserved, 0xFF invalid) and SM/chain are decoded per family — the SM
extraction and the chaining bit (b5, not b6) were off by one bit
- per-channel state: database._decode_rows/_replay_context use the shared
cla_channel() helper — before, CLA & 0x03 with no +4, so a channel-5
SELECT clobbered channel 1's selection and a channel-8 one channel 0's
(the local traces already open channels: 29 MANAGE CHANNEL opens, 1-2)
- COMPRION T=0 import: the synthesized GET RESPONSE keeps the channel —
a plain CLA for 0-3 (as real terminals do) and 01x0 for 4-19
- ATR historical bytes: the UICC's COMPACT-TLV objects (TS 102 221 §6.3.1)
with card service data, the card capabilities (ISO 7816-4 §8.1.1.2.7
Table 88: assignment methods and max logical channels — the workspace
cards announce 4 and "8 or more") and the status indicator ('00' trailing
bytes / the '8Y' TLV); a truncated ATR no longer raises
- MANAGE CHANNEL success replies decode the assigned channel byte
- capture/import: a 'tpdu' packet that is not APDU-shaped (shorter than the
header, CLA FF, ISO-reserved class) is skipped and counted, so a
character-level or mis-sampled stream no longer pollutes the decode
(the local DB's outlier sessions are exactly that)
- tests: CLA table vectors, per-channel state isolation on channels 8/12,
COMPRION GR channels, filetrack extended channels, ATR compact-TLV and
card-capability cases, the capture skip counter, the PWA rows; 527 Python
+ 47 Node tests
- README/README_RUS document the extended channels, card capabilities and
the skip counter; PWA_VERSION/pyproject/version.py 2.6.0, SW v72
This commit is contained in:
1 parent
cbeeed3608
commit
64433f9739
18 files changed
+683
-88
No files matched your search
@@ -288,7 +288,7 @@ class Database:
|
||||
selection, DF, SFI map, and the last RST-reported CLK frequency.
|
||||
|
||||
Returns ``(states, clk_hz)``."""
|
||||
from .decode import decode_sniff_msg
|
||||
from .decode import cla_channel, decode_sniff_msg
|
||||
rows = self._conn.execute(
|
||||
"SELECT data, type FROM messages WHERE session_id=? AND id < ? "
|
||||
"AND type IN ('tpdu','atr','change','gap','rst','vcc') "
|
||||
@@ -307,7 +307,7 @@ class Database:
|
||||
if d and d.get('clk_hz'):
|
||||
clk_hz = d['clk_hz']
|
||||
continue
|
||||
channel = data[0] & 0x03 if data and len(data) >= 1 else 0
|
||||
channel = cla_channel(data[0]) if data else 0
|
||||
st = self._channel_state(states, channel)
|
||||
ctx = dict(st['prev']) if st['prev'] else {}
|
||||
ctx['sel'] = st['sel']
|
||||
@@ -387,7 +387,7 @@ class Database:
|
||||
return sel
|
||||
|
||||
def _decode_rows(self, rows, initial_states=None, clk_hz=None, on_message=None):
|
||||
from .decode import atr_rate_fields
|
||||
from .decode import atr_rate_fields, cla_channel
|
||||
msgs = []
|
||||
states = dict(initial_states or {})
|
||||
last_atr_i = None # index of the most recent ATR in *msgs*
|
||||
@@ -395,7 +395,7 @@ class Database:
|
||||
for row in rows:
|
||||
channel = 0
|
||||
if row[3] == 'tpdu' and row[4] and len(row[4]) >= 5:
|
||||
channel = row[4][0] & 0x03
|
||||
channel = cla_channel(row[4][0])
|
||||
st = self._channel_state(states, channel)
|
||||
ctx = dict(st['prev']) if st['prev'] else {}
|
||||
ctx['sel'] = st['sel']
|
||||
|
||||
Reference in new issue
Block a user