diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 0a9696e..d985b85 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -55,7 +55,7 @@

2.1 SIM RFM

CLA = A0 (GSM 11.11 / TS 151 011, ISO 7816-4). Удалённое управление файлами классических SIM-карт.

-

Команды собираются в виде цепочки: нажмите кнопку + SELECT (или другую командную кнопку), чтобы добавить строку, заполните её поля — предпросмотр цепочки (над кнопкой упаковки) обновится автоматически. Добавьте строку GET RESPONSE, чтобы получить данные после SELECT. Кнопка Упаковать в Secured packet упаковывает всю цепочку в пакет SCP80 и устанавливает TAR SCP80 в UICC TAR выбранной предустановки (по умолчанию B00000). Текущий DF сессии SIM RFM — MF, поэтому пути SELECT адресуют файлы от MF.

+

Команды собираются в виде цепочки: нажмите кнопку + SELECT (или другую командную кнопку), чтобы добавить строку, заполните её поля — предпросмотр цепочки (над кнопкой упаковки) обновится автоматически. Добавьте строку GET RESPONSE, чтобы получить данные после SELECT. Кнопка Упаковать в Secured packet упаковывает всю цепочку в пакет SCP80 и устанавливает TAR SCP80 в UICC RFM TAR выбранной предустановки (по умолчанию B00000) — TAR UICC Shared File System RFM: MF выбирается неявно, ADF недоступны, поэтому пути SELECT адресуют файлы от MF.

@@ -95,8 +95,8 @@

CLA = 00 (ETSI TS 102 221). Тот же сборщик цепочки и набор команд, что и SIM. Отличия:

@@ -299,7 +299,7 @@

4. Вкладка «Карты»

-

Хранит предустановки карт локально в браузере (localStorage), чтобы представление Secured Packet могло автоматически подставлять ключи и параметры, а слушатель SCP81 HTTP OTA — находить PSK-ключи. «Карты» — верхнеуровневая вкладка. При подключении карты читается её EF.ICCID, и предустановка с тем же ICCID автоматически выбирается в обоих представлениях SCP80. Поля формы сгруппированы в два блока с рамкой: SCP80 (GSM 03.48, ETSI TS 102 225) (KIc/KID, SPI1/SPI2, TAR-ы ISD/UICC/USIM, счётчик и ключи) и SCP81 (HTTP OTA) (пара PSK identity/ключ с пояснением о выборе ключа). Необязательное поле ADM находится в верхней строке и сохраняется для последующего использования файловым менеджером.

+

Хранит предустановки карт локально в браузере (localStorage), чтобы представление Secured Packet могло автоматически подставлять ключи и параметры, а слушатель SCP81 HTTP OTA — находить PSK-ключи. «Карты» — верхнеуровневая вкладка. При подключении карты читается её EF.ICCID, и предустановка с тем же ICCID автоматически выбирается в обоих представлениях SCP80. Поля формы сгруппированы в два блока с рамкой: SCP80 (GSM 03.48, ETSI TS 102 225) (KIc/KID, SPI1/SPI2, TAR-ы ISD/UICC RFM/ADF RFM, счётчик и ключи) и SCP81 (HTTP OTA) (пара PSK identity/ключ с пояснением о выборе ключа). Необязательное поле ADM находится в верхней строке и сохраняется для последующего использования файловым менеджером.

КомандаINSОписание
@@ -308,16 +308,16 @@ - - - + + +
ПолеОписание
ADMНеобязательный администраторский PIN (hex или до 8 ASCII-цифр), сохраняется в предустановке для последующего использования файловым менеджером; представлениями SCP80/SCP81 не используется
KIc / KIDИндикаторы ключа и алгоритма (например, 15 = индекс 1, 3DES-CBC2; x2 = AES); задаются вместе с ключами
SPI1 / SPI2Security Parameter Indicators
ISD TARToolkit Application Reference для операций ISD/RAM (представление SCP80 RAM, цепочки RAM/GP); по умолчанию по спецификации 000000, подставляется при пустом значении
UICC TARTAR для SIM RFM (TS 31.116); по умолчанию B00000 — сессия SIM RFM выбирает файлы от MF
USIM TARTAR для USIM RFM (TS 31.115); по умолчанию B00001 — текущий DF сессии USIM RFM — ADF.USIM
ISD TARTAR Issuer Security Domain (TS 101 220, приложение D); используется для операций RAM/GP (представление SCP80 RAM, цепочки RAM/GP); по умолчанию по спецификации 000000, подставляется при пустом значении
UICC RFM TARTAR UICC Shared File System RFM (TS 102 226 §7.2, TS 101 220 приложение D): MF выбирается неявно и доступны только файлы под MF (ADF недоступны); используется представлением SIM RFM; по умолчанию B00000
ADF RFM TARTAR ADF RFM (TS 102 226 §7.3, TS 101 220 приложение D): ADF выбирается неявно, TAR привязан к AID приложения — ADF.USIM в представлении USIM RFM; по умолчанию B00001
CounterСчётчик повторов (5 байт); увеличивается и сохраняется после каждой успешной отправки SCP80
KIc key / KID key16/24/32 hex-символа (ключи 8/16/24 байта 3DES) или 32/48/64 hex-символа (ключи 16/24/32 байта AES)
PSK identitySCP81 HTTP OTA: идентификатор, который карта присылает в TLS-рукопожатии (например, 89390100000129506903)
PSK keySCP81 HTTP OTA: 32 hex-символа (16 байт) для PSK TLS-слушателя; ключ выбирается по идентификатору, который предъявляет карта
-

Столбец SCP81 показывает, задана ли в предустановке рабочая пара PSK: (зелёный) — идентификатор и ключ заданы; (жёлтый) — задано только одно из двух, и слушатель такую предустановку игнорирует; — PSK нет. Идентификатор и ключ PSK задаются вместе. Кнопка Редактировать загружает предустановку в форму (кнопка Add становится Сохранить; Отмена очищает форму), поэтому поля можно менять без повторного ввода карты; Удалить удаляет строку. Обмен предустановками: Экспорт в файл для выгрузки и Импорт из файла для загрузки. Выбранная предустановка автоматически заполняет форму Secured Packet и устанавливает TAR для операции (RAM/GP → ISD TAR, SIM RFM → UICC TAR, USIM RFM → USIM TAR); изменения сразу передаются работающему слушателю SCP81.

+

Столбец SCP81 показывает, задана ли в предустановке рабочая пара PSK: (зелёный) — идентификатор и ключ заданы; (жёлтый) — задано только одно из двух, и слушатель такую предустановку игнорирует; — PSK нет. Идентификатор и ключ PSK задаются вместе. Кнопка Редактировать загружает предустановку в форму (кнопка Add становится Сохранить; Отмена очищает форму), поэтому поля можно менять без повторного ввода карты; Удалить удаляет строку. Обмен предустановками: Экспорт в файл для выгрузки и Импорт из файла для загрузки. Выбранная предустановка автоматически заполняет форму Secured Packet и устанавливает TAR для операции (RAM/GP → ISD TAR, SIM RFM → UICC RFM TAR, USIM RFM → ADF RFM TAR); изменения сразу передаются работающему слушателю SCP81.

diff --git a/frontend/help.html b/frontend/help.html index 18fd790..a514720 100644 --- a/frontend/help.html +++ b/frontend/help.html @@ -55,7 +55,7 @@

2.1 SIM RFM

CLA = A0 (GSM 11.11 / TS 151 011, ISO 7816-4). Remote File Management for classic SIM cards.

-

Commands are assembled as a chain: press a command button (e.g. + SELECT) to append a row, fill that row’s fields, and the chain preview (above the pack button) updates automatically. Add a GET RESPONSE row to fetch data following a SELECT. Press Pack into Secured packet to wrap the whole chain into an SCP80 packet; packing sets the SCP80 TAR to the selected preset’s UICC TAR (B00000 by default). A SIM RFM session’s current DF is MF, so SELECT paths address files from MF.

+

Commands are assembled as a chain: press a command button (e.g. + SELECT) to append a row, fill that row’s fields, and the chain preview (above the pack button) updates automatically. Add a GET RESPONSE row to fetch data following a SELECT. Press Pack into Secured packet to wrap the whole chain into an SCP80 packet; packing sets the SCP80 TAR to the selected preset’s UICC RFM TAR (B00000 by default), the UICC Shared File System RFM TAR: the MF is implicitly selected and no ADF can be accessed, so SELECT paths address files from MF.

@@ -95,8 +95,8 @@

CLA = 00 (ETSI TS 102 221). Same chain builder and command set as SIM. Differences:

@@ -299,7 +299,7 @@

4. Cards tab

-

Stores card presets locally in the browser (localStorage) so the Secured Packet view can auto-fill keys and parameters, and so the SCP81 HTTP OTA listener can look up PSK keys. Cards is a top-level tab. When the card is equipped its EF.ICCID is read and the preset with the same ICCID is selected automatically in both SCP80 views. The form groups the fields into two bordered blocks: SCP80 (GSM 03.48, ETSI TS 102 225) (KIc/KID, SPI1/SPI2, the ISD/UICC/USIM TARs, counter and keys) and SCP81 (HTTP OTA) (the PSK identity/key pair with the key-selection note). The optional ADM field sits in the top row and is stored for later use by the file manager.

+

Stores card presets locally in the browser (localStorage) so the Secured Packet view can auto-fill keys and parameters, and so the SCP81 HTTP OTA listener can look up PSK keys. Cards is a top-level tab. When the card is equipped its EF.ICCID is read and the preset with the same ICCID is selected automatically in both SCP80 views. The form groups the fields into two bordered blocks: SCP80 (GSM 03.48, ETSI TS 102 225) (KIc/KID, SPI1/SPI2, the ISD/UICC RFM/ADF RFM TARs, counter and keys) and SCP81 (HTTP OTA) (the PSK identity/key pair with the key-selection note). The optional ADM field sits in the top row and is stored for later use by the file manager.

CommandINSDescription
@@ -308,16 +308,16 @@ - - - + + +
FieldDescription
ADMOptional administrator PIN (hex, or up to 8 ASCII digits), stored in the preset for later use by the file manager; not used by the SCP80/SCP81 views
KIc / KIDKey and algorithm indicators (e.g. 15 = index 1, 3DES-CBC2; x2 = AES), required together with the keys
SPI1 / SPI2Security Parameter Indicators
ISD TARToolkit Application Reference for ISD/RAM operations (SCP80 RAM view, RAM/GP chains); spec default 000000, prefilled when empty
UICC TARTAR for SIM RFM (TS 31.116); spec default B00000 — a SIM RFM session selects from MF
USIM TARTAR for USIM RFM (TS 31.115); spec default B00001 — a USIM RFM session's current DF is ADF.USIM
ISD TARIssuer Security Domain TAR (TS 101 220 Annex D); used for RAM/GP operations (SCP80 RAM view, RAM/GP chains); spec default 000000, prefilled when empty
UICC RFM TARUICC Shared File System RFM TAR (TS 102 226 §7.2, TS 101 220 Annex D): the MF is implicitly selected and only files under the MF are accessible (no ADFs); used by the SIM RFM view; spec default B00000
ADF RFM TARADF RFM TAR (TS 102 226 §7.3, TS 101 220 Annex D): the ADF is implicitly selected and the TAR is linked to the application's AID — ADF.USIM in the USIM RFM view; spec default B00001
CounterReplay counter (5 bytes); advanced and saved after each successful SCP80 send
KIc key / KID key16/24/32 hex chars (8/16/24-byte 3DES) or 32/48/64 hex chars (16/24/32-byte AES) keys
PSK identitySCP81 HTTP OTA: the identity the card sends in the TLS handshake (e.g. 89390100000129506903)
PSK keySCP81 HTTP OTA: 32 hex chars (16 bytes) for the PSK TLS listener, picked by the identity the card presents
-

The SCP81 column shows whether the preset supplies a usable PSK pair: (green) — identity and key set; (amber) — only one of the two, so the listener ignores the preset; — no PSK. PSK identity and key must be set together. Edit loads a preset into the form (the Add button becomes Save; Cancel clears it) so fields can be changed without re-entering the card; Remove deletes the row. Presets can be shared with Export to file and restored with Import from file. The selected card preset auto-fills the Secured Packet form and sets the TAR for the operation (RAM/GP → ISD TAR, SIM RFM → UICC TAR, USIM RFM → USIM TAR); edits are pushed into a running SCP81 listener automatically.

+

The SCP81 column shows whether the preset supplies a usable PSK pair: (green) — identity and key set; (amber) — only one of the two, so the listener ignores the preset; — no PSK. PSK identity and key must be set together. Edit loads a preset into the form (the Add button becomes Save; Cancel clears it) so fields can be changed without re-entering the card; Remove deletes the row. Presets can be shared with Export to file and restored with Import from file. The selected card preset auto-fills the Secured Packet form and sets the TAR for the operation (RAM/GP → ISD TAR, SIM RFM → UICC RFM TAR, USIM RFM → ADF RFM TAR); edits are pushed into a running SCP81 listener automatically.

diff --git a/frontend/index.html b/frontend/index.html index 09acb4b..3eb1ea4 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1226,15 +1226,26 @@
SCP80 (GSM 03.48, ETSI TS 102 225) -
+
- - - +
+
+ + +
+
+ + +
+
+ + +
+
@@ -1258,7 +1269,7 @@ KID SPI1 SPI2 - TAR (ISD/UICC/USIM) + TAR (ISD/UICC RFM/ADF RFM) Cntr SCP81 @@ -6263,7 +6274,7 @@ function cardsRender() { html += '' + esc(c.kid) + ''; html += '' + esc(c.spi1) + ''; html += '' + esc(c.spi2) + ''; - html += '' + esc(cardsTarValue('tar', c.tar)) + ' ' + esc(cardsTarValue('uiccTar', c.uiccTar)) + ' ' + esc(cardsTarValue('usimTar', c.usimTar)) + ''; + html += '' + esc(cardsTarValue('tar', c.tar)) + ' ' + esc(cardsTarValue('uiccTar', c.uiccTar)) + ' ' + esc(cardsTarValue('usimTar', c.usimTar)) + ''; html += '' + esc(c.cntr) + ''; html += '' + ota + ''; html += ' ' diff --git a/frontend/sw.js b/frontend/sw.js index e9eae51..6942546 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'simple-v199'; +const CACHE = 'simple-v200'; const URLS = [ 'index.html', 'help.html', diff --git a/frontend/tests/html.test.js b/frontend/tests/html.test.js index a615595..1487a63 100644 --- a/frontend/tests/html.test.js +++ b/frontend/tests/html.test.js @@ -36,6 +36,12 @@ test('the card form groups the SCP80 and SCP81 fields into labelled fieldsets', assert.match(scp80, /id="cards-tar"[^>]*value="000000"/); assert.match(scp80, /id="cards-uicc-tar"[^>]*value="B00000"/); assert.match(scp80, /id="cards-usim-tar"[^>]*value="B00001"/); + // the TAR fields are labelled and sit to the right of Counter + assert.match(scp80, />ISD TAR<\/label>/); + assert.match(scp80, />UICC RFM TAR<\/label>/); + assert.match(scp80, />ADF RFM TAR<\/label>/); + assert.ok(scp80.indexOf('id="cards-cntr"') < scp80.indexOf('id="cards-tar"'), + 'TAR fields must follow the Counter field'); assert.match(scp81, /id="cards-psk-id"/); assert.match(scp81, /id="cards-psk-key"/); // the PSK explanation lives inside the SCP81 group, not outside it