From 82f45d488f9e7417db38369d0c6f78bc211fcc7e 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: Wed, 23 Sep 2026 22:58:22 +0300 Subject: [PATCH] ui: guided OPEN CHANNEL parameters for the BIP opening request (v3.5.0) The 01 (BIP channel opening) variant was raw hex while 03 (TCP) had a detailed form. The asymmetry is real - 01 accepts any OPEN CHANNEL COMPREHENSION-TLVs (TS 102 226 9.2.1) while 03's set is fixed by 9.2.3 - so 01 now offers a Fields/Hex switch instead of a rigid form: - Fields (default) composes the most-used OPEN CHANNEL parameters per SIMalliance Stepping Stones R7 18.6.1: bearer description (default 35 01 03), transport protocol (UDP 01 / TCP 02, UICC client, remote - the only values TS 102 223 6.6.27.4 allows when the transport level is present) with the destination port, destination address, NAA/APN, buffer size, alpha (transparent checkbox -> 05 00 = no user confirmation) and an extra-TLVs field for login/password and anything else. The local address is never emitted (9.2.1 and the guide forbid it). - Hex keeps the raw COMPREHENSION-TLVs field; pushOpenChannelTlvs() is a pure, vector-tested composer feeding the same encoder as before. Help 2.7 EN/RU and the READMEs explain the two modes; sw cache -> simple-v251; version stays 3.5.0. --- README.md | 2 +- README_RUS.md | 2 +- frontend/help-ru.html | 2 +- frontend/help.html | 2 +- frontend/index.html | 103 ++++++++++++++++++++++++++++++-- frontend/sw.js | 2 +- frontend/tests/ts102226.test.js | 48 ++++++++++++--- 7 files changed, 144 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index f26cdd9..9323720 100644 --- a/README.md +++ b/README.md @@ -381,7 +381,7 @@ The **Command Scripting template** checkbox wraps the whole `81` triggering comm The **Channel / link trigger** sub-pill builds the §9 requests with the same encoder as the RAM/GP chain's **PUSH** row and offers **Pack into Secured packet** (TAR stays manual - the request goes to the target application) and **→ Expanded Script** (each APDU becomes a `22` Command TLV): -- **BIP channel opening** (`01`) - OPEN CHANNEL COMPREHENSION-TLVs optional; the application issues the proactive OPEN CHANNEL itself. SIMalliance Stepping Stones R7 §18.6 recommends sending it together with the CAT_TP request in the same message (channel parameters in `01`, CAT_TP port in `02`) - the form has an *Also request the CAT_TP link establishment (02)* checkbox and the pair goes out as one concatenated command script; +- **BIP channel opening** (`01`) - built in *Fields* mode from the most-used OPEN CHANNEL parameters (bearer, UDP/TCP client remote + port, destination address, NAA/APN, buffer size, alpha; the local address is never emitted), or in *Hex* mode with the raw COMPREHENSION-TLVs; the application issues the proactive OPEN CHANNEL itself. SIMalliance Stepping Stones R7 §18.6 recommends sending it together with the CAT_TP request in the same message (channel parameters in `01`, CAT_TP port in `02`) - the form has an *Also request the CAT_TP link establishment (02)* checkbox and the pair goes out as one concatenated command script; - **CAT_TP link** (`02`) - destination port in transport level `3C` with protocol type 00 (mandatory), optional buffer size `39` / identification data `36`; standalone it relies on card-provisioned defaults, so prefer the pair above; - **TCP connection** (`03`) - bearer `35`, transport level `3C` with protocol type 02, destination address `3E` (`21` IPv4 / `57` IPv6 / `F0` FQDN), NAA/APN `47`; the parameters are the OPEN CHANNEL TCP set and are mandatory in the request, so `03` is self-contained (no companion `01`) - the connection is established over BIP or a direct IP connection (TS 102 483) where supported; - **Identification packet** (`04`) is not a trigger - it needs an already open TCP channel, so the TCP request has an *Also send the identification packet (04)* checkbox that appends it in the same message; `04` also stays in the chain's PUSH row for scripts. diff --git a/README_RUS.md b/README_RUS.md index 407dd28..a462dd6 100644 --- a/README_RUS.md +++ b/README_RUS.md @@ -356,7 +356,7 @@ CLA = `80` (GlobalPlatform v2.3.1). Удалённое управление со Подвкладка **«Триггер канала/линка»** собирает запросы §9 тем же кодировщиком, что и строка **PUSH** в цепочке RAM/GP, и предлагает **«Упаковать в Secured packet»** (TAR остаётся ручным — запрос адресован целевому приложению) и **→ Расширенный скрипт** (каждый APDU становится Command TLV `22`): -- **Открытие BIP-канала** (`01`) — COMPREHENSION-TLV OPEN CHANNEL необязательны; проактивную команду OPEN CHANNEL выдаёт само приложение. Stepping Stones R7 §18.6 рекомендует отправлять его вместе с CAT_TP-запросом в одном сообщении (параметры канала в `01`, порт CAT_TP в `02`) — в форме есть флажок «Также запросить установление соединения CAT_TP (02)», пара уходит одним скриптом команд; +- **Открытие BIP-канала** (`01`) — собирается в режиме *Fields* из самых употребительных параметров OPEN CHANNEL (bearer, UDP/TCP клиент + порт, адрес назначения, NAA/APN, размер буфера, alpha; локальный адрес не отправляется), либо в режиме *Hex* с сырыми COMPREHENSION-TLV; проактивную команду OPEN CHANNEL выдаёт само приложение. Stepping Stones R7 §18.6 рекомендует отправлять его вместе с CAT_TP-запросом в одном сообщении (параметры канала в `01`, порт CAT_TP в `02`) — в форме есть флажок «Также запросить установление соединения CAT_TP (02)», пара уходит одним скриптом команд; - **CAT_TP** (`02`) — порт назначения в transport level `3C` с типом 00 (обязателен), необязательные buffer size `39` / данные идентификации `36`; отдельно полагается на предустановленные на карте умолчания, поэтому предпочтительна пара выше; - **TCP-соединение** (`03`) — bearer `35`, transport level `3C` с типом 02, адрес назначения `3E` (`21` IPv4 / `57` IPv6 / `F0` FQDN), NAA/APN `47`; это параметры OPEN CHANNEL для TCP, и они обязательны в запросе, поэтому `03` самодостаточен (сопутствующий `01` не нужен) — соединение устанавливается через BIP или прямое IP-соединение по TS 102 483, где поддерживается; - **Пакет идентификации** (`04`) — не триггер: ему нужен уже открытый TCP-канал, поэтому у TCP-запроса есть флажок «Также отправить пакет идентификации (04)», добавляющий его в то же сообщение; `04` также остаётся в строке PUSH цепочки для сценариев. diff --git a/frontend/help-ru.html b/frontend/help-ru.html index a9d0641..16d10ef 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -255,7 +255,7 @@

PUSH по TS 102 226 §9

Подвкладка «Триггер канала/линка» собирает запросы §9 тем же кодировщиком, что и строка PUSH в цепочке RAM/GP, показывает предпросмотр C-APDU, и предлагает «Упаковать в Secured packet» (TAR остаётся ручным: запрос адресован целевому приложению, а не Security Domain) и → Расширенный скрипт (оборачивает каждый APDU в Command TLV 22 и добавляет их в конструктор Expanded Script).