ui: group the TCP request with the channel/link triggers; identification packet as a same-message follow-up

The Push commands pill now has three sub-pills: Trigger (Push SMS), Store
(SD admin params) and Channel / link trigger, which builds all three TS 102 226
§9 establishment requests - 01 BIP channel opening (OPEN CHANNEL), 02 CAT_TP
link, 03 TCP connection - with one shared destination-port field and
per-request field visibility.  The TCP parameters are the OPEN CHANNEL TCP
set (BIP, or a direct IP connection per TS 102 483 where supported), so 03
belongs with the other channel/link requests.

The identification packet (04) is not a trigger: it presupposes an already
open TCP channel and only makes sense as a follow-up in the same message, so
it is no longer a standalone request.  The TCP request carries an "Also send
the identification packet (04) in the same message" checkbox (optional data,
ICCID when empty): the preview then shows both commands (a command string sent
in one secured packet) and → Expanded Script appends one 22 Command TLV per
command.  pushSectionApdus() returns the APDU list; 04 stays available in the
RAM/GP chain's PUSH row for script sequences.

Help 2.7 EN/RU, READMEs and AGENTS describe the three sub-pills and the BIP vs
direct-IP nuance; sw cache -> simple-v249; version stays 3.5.0.

html.test.js also asserts that the document is complete (ends with </html>,
every <script> closed, the inline script parses and defines cApduSwitchSubtab):
a truncated index.html made the browser fail to parse the inline script, so
every onclick handler reported "function is not defined" while the Node tests
still passed.
This commit is contained in:
2026-09-23 22:11:30 +03:00
parent 731cb53105
commit 9cbf301f09
8 changed files with 162 additions and 134 deletions
+6 -5
View File
@@ -230,7 +230,7 @@
<p class="text-sm mb-3">Pastes raw APDU hex and renders a collapsible tree. It auto-detects the container: an <strong>Expanded Script</strong> (leading <code class="font-mono text-sm">AA</code> or <code class="font-mono text-sm">AE80</code>, decoded per ETSI TS 102 226 &sect;5.2.1) or a <strong>Compact C-APDU chain</strong> (a sequence of ISO 7816 C-APDUs). Each node shows its label, hex and a short description; parent nodes expand to reveal their sub-elements. The <strong>C-APDU Parser</strong> and <strong>R-APDU parser</strong> are the two sub-pills of the <strong>Parser</strong> pill.</p>
<h3 id="push-commands" class="text-lg font-medium mb-2">2.7 Push commands</h3>
<p class="text-sm mb-3">Groups the commands that make the card dial out. Four sub-pills switch between the forms &mdash; <strong>Trigger (Push SMS)</strong>, <strong>Store (SD admin params)</strong>, <strong>BIP / CAT_TP trigger</strong> and <strong>TCP trigger</strong> &mdash; and only the selected form is shown; the two GP forms share one set of fields (the mode only changes how the payload is wrapped, and the form heading says which one). They come from different specs and are delivered differently: the administration trigger is a TLV message for the Security Domain (HTTP OTA), a &sect;9 PUSH is a C-APDU (<code class="font-mono text-sm">80 EC 01 P2</code>) for an application that supports BIP and/or CAT_TP.</p>
<p class="text-sm mb-3">Groups the commands that make the card dial out. Three sub-pills switch between the forms &mdash; <strong>Trigger (Push SMS)</strong>, <strong>Store (SD admin params)</strong> and <strong>Channel / link trigger</strong> &mdash; and only the selected form is shown; the two GP forms share one set of fields (the mode only changes how the payload is wrapped, and the form heading says which one). They come from different specs and are delivered differently: the administration trigger is a TLV message for the Security Domain (HTTP OTA), a &sect;9 PUSH is a C-APDU (<code class="font-mono text-sm">80 EC 01 P2</code>) for an application that supports BIP and/or CAT_TP.</p>
<h4 id="http-ota" class="font-medium mb-1">Administration session (HTTP OTA)</h4>
<p class="text-sm mb-3">Builds the Remote Application Management over HTTP payloads defined in GlobalPlatform <strong>GPC v2.2 Amendment B v1.1</strong> (&sect;4.7). Two modes:</p>
@@ -252,11 +252,12 @@
<p class="text-sm mb-2"><strong>Pack into Secured packet</strong> sends the built payload to the SCP80 tab for SPI/counter filling &mdash; insert the TAR the SD listens on (typically the OTASD TAR) there.</p>
<h4 id="push-ts102226" class="font-medium mb-1 mt-3">TS 102 226 §9 PUSH</h4>
<p class="text-sm mb-2">Two guided sections build the &sect;9 requests with the same encoder as the RAM/GP chain's <strong>PUSH</strong> row, preview the C-APDU, and offer <strong>Pack into Secured packet</strong> (the TAR stays manual: the request is addressed to the target application, not the Security Domain) and <strong>&rarr; Expanded Script</strong> (wraps the APDU in the <code class="font-mono text-sm">22</code> Command TLV and appends it to the Expanded Script builder).</p>
<p class="text-sm mb-2">The <strong>Channel / link trigger</strong> sub-pill builds the &sect;9 requests with the same encoder as the RAM/GP chain's <strong>PUSH</strong> row, previews the C-APDU(s), and offers <strong>Pack into Secured packet</strong> (the TAR stays manual: the request is addressed to the target application, not the Security Domain) and <strong>&rarr; Expanded Script</strong> (wraps each APDU in the <code class="font-mono text-sm">22</code> Command TLV and appends them to the Expanded Script builder).</p>
<ul class="list-disc list-inside text-sm space-y-1 mb-3">
<li><strong>BIP / CAT_TP</strong> &mdash; request <code class="font-mono text-sm">01</code> BIP channel opening (optional OPEN CHANNEL COMPREHENSION-TLVs; the application defaults apply when empty) or <code class="font-mono text-sm">02</code> CAT_TP link establishment (destination port in transport level <code class="font-mono text-sm">3C</code> with protocol type 00, optional buffer size <code class="font-mono text-sm">39</code> / identification data <code class="font-mono text-sm">36</code>).</li>
<li><strong>TCP</strong> &mdash; request <code class="font-mono text-sm">03</code> TCP connection (bearer <code class="font-mono text-sm">35</code>, transport level <code class="font-mono text-sm">3C</code> with protocol type 02 = TCP client remote, destination address <code class="font-mono text-sm">3E</code> with type <code class="font-mono text-sm">21</code> IPv4 / <code class="font-mono text-sm">57</code> IPv6 / <code class="font-mono text-sm">F0</code> FQDN, NAA/APN <code class="font-mono text-sm">47</code>) or <code class="font-mono text-sm">04</code> identification packet (optional data, ICCID when absent &mdash; sent over an already open TCP channel, not a trigger).</li>
<li>Mandatory parameters are enforced in the guided sections: <code class="font-mono text-sm">02</code> needs the destination port, <code class="font-mono text-sm">03</code> the port and the destination address. The RAM/GP chain row keeps the lenient behaviour for free-form scripting.</li>
<li><strong>BIP channel opening</strong> (<code class="font-mono text-sm">01</code>) &mdash; optional OPEN CHANNEL COMPREHENSION-TLVs; the application defaults apply when empty. The application issues the proactive OPEN CHANNEL itself (&sect;9.1.1).</li>
<li><strong>CAT_TP link establishment</strong> (<code class="font-mono text-sm">02</code>) &mdash; destination port in transport level <code class="font-mono text-sm">3C</code> with protocol type 00 (mandatory), optional buffer size <code class="font-mono text-sm">39</code> / identification data <code class="font-mono text-sm">36</code>.</li>
<li><strong>TCP connection</strong> (<code class="font-mono text-sm">03</code>) &mdash; bearer <code class="font-mono text-sm">35</code>, transport level <code class="font-mono text-sm">3C</code> with protocol type 02 = TCP client remote, destination address <code class="font-mono text-sm">3E</code> (<code class="font-mono text-sm">21</code> IPv4 / <code class="font-mono text-sm">57</code> IPv6 / <code class="font-mono text-sm">F0</code> FQDN), NAA/APN <code class="font-mono text-sm">47</code>; port and address are mandatory. These are the OPEN CHANNEL TCP parameters: the application establishes the connection over BIP or, where the card and terminal support it, over a direct IP connection (TS 102 483).</li>
<li><strong>Identification packet</strong> (<code class="font-mono text-sm">04</code>) is not a trigger: it presupposes an already open TCP channel and only makes sense as a follow-up in the same message, so the TCP request carries an <em>Also send the identification packet (04)</em> checkbox that appends it (optional data; the ICCID is used when empty). <code class="font-mono text-sm">04</code> also stays available in the RAM/GP chain's PUSH row for script sequences.</li>
</ul>