v3.14.0: event form object-set fixes + the slices single-envelope mandate

An audit of every event form against the pinned specs (31.111 7.5.x/9.3,
102 223 8.87, TS 101 220's master tag table) found three missing objects,
three malformed/wrong ones, and settled the slice-data scope.

- 0x00 MT call: the IMS URI object is cut at 100 bytes and now carries the
  URI truncated object (8.135, F3 00) when the cut happened.
- 0x1F Slices: the form gains the Partial NSSAI object (8.154, F9, rel 18);
  a single envelope carrying it is marked as the Last Envelope (8.79,
  F0 00) automatically (7.5.27.2).
- 0x06 Card reader status and 0x07 Language: the builders now emit their
  object tags (A0 01 ..., AD ...) - they emitted bare values before.
- 0x18 Incoming IMS data: the IARI tag is F6 (76/F6), not F7 (which is the
  IMPU list tag - the two-column 9.3 table had been misread).
- Single-envelope mandate: the event data is capped at 244 bytes (inner 252;
  the D6 long-form length and the APDU Lc stay in one byte).  The server
  refuses more with a 400 and the PWA shows the size error before sending.
  Chained (multi-envelope) delivery, the More Data object and envelope
  sequences are not implemented - documented in the help and the repo AGENTS.
- Tests: event form vectors (URI truncation, the restored tags, partial /
  Last Envelope, the size helper) and the server guard; the release
  reference and its PWA/code mirrors gain the three objects and the
  corrected IARI key.
- sw cache simple-v375.
This commit is contained in:
2026-10-02 14:34:47 +03:00
parent 7c2841ca06
commit c18b6cd0d4
9 changed files with 114 additions and 16 deletions
+14
View File
@@ -934,6 +934,20 @@ class TestEventDownload(unittest.TestCase):
d6 = bytes([0xD6, 0x81, len(inner)]) + inner
self.assertEqual(apdu, '80c20000%02x%s' % (len(d6), d6.hex()))
def test_event_data_beyond_one_envelope_is_refused(self):
# the tool sends one envelope per event: the inner data is capped at
# 252 bytes (the D6 long-form length and the APDU Lc stay in one byte);
# chained (multi-envelope) delivery is not implemented
with self.assertRaises(ValueError) as ctx:
self._send(0x1F, bytes(245))
self.assertIn('one ENVELOPE', str(ctx.exception))
# 244 bytes of event data still fit (inner = 252, the maximum)
apdu, sw = self._send(0x1F, bytes(244))
self.assertEqual(sw, '9000')
inner = bytes([0x99, 0x01, 0x1F, 0x82, 0x02, 0x82, 0x81]) + bytes(244)
d6 = bytes([0xD6, 0x81, len(inner)]) + inner
self.assertEqual(apdu, '80c20000%02x%s' % (len(d6), d6.hex()))
class TestTimerManagement(unittest.TestCase):
"""Terminal side of TIMER MANAGEMENT (TS 102 223 6.6.21, 6.8.13/14, 7.4).