Commit Graph

227 Commits

Author SHA1 Message Date
catarrh 01931b9693 Fix Error Action proactive: filter REFRESH out of allowed commands
When Error Action (tag 82) uses the Proactive command subtype, only
DISPLAY TEXT and PLAY TONE are allowed per TS 102 226 Table 5.9.
Pass allowed=['display','tone'] to buildBerPcHtml for error-type rows.
2026-08-20 21:34:38 +03:00
catarrh 03ec13364c Fix onErrorActionTypeChange: sel.nextElementSibling -> sel.parentElement.nextElementSibling
The Error Action HTML structure wraps the select in a flex div sibling to
the .error-action-body div, so sel.nextElementSibling was null.
2026-08-20 21:29:07 +03:00
catarrh e6602c40bf RAM constructor fixes: EA/CA nesting, access domain order, menu pairs, BER lengths, services byte (TS 102 226)
- UICC Toolkit tag 80 nested inside EA (EA 12 80 10 ...)
- ram-tk-mode value ea (was 80), label 'UICC Toolkit (Tag EA)'
- SIM (CA) access domain FIRST in payload, blank = 00
- Menu entries: 2×m pairs (i=1 first, i=m last, else 0000)
- CA/EA lengths via berLenStr() (supports 81xx long form)
- UICC trailing 'Maximum number of services' byte (ram-tk-services)
- DELETE: P1=00 fixed, mode in P2 (80E4 00 <mode> ...)
- STORE DATA: ram-enc 00/40/80/C0/E0 with correct labels
- LOAD: P1 fixed to 0x80 (last block)
- USIM SELECT: selP1 0x09 -> 0x00 (select by file id)
- ram.test.js: 11 exact-hex tests from exchange vectors
- v1.8.1, SW cache otaman-v9
2026-08-20 21:23:37 +03:00
catarrh 4a6a142c3d Expanded Format spec fixes: REFRESH qualifiers, Error Action forms, Script Chaining flags, CR-bit tags (TS 102 226)
- BER_QUAL.refresh: full TS 102 223 §8.6 table (00-0A)
- Error Action rebuilt as single select: Proactive (DISPLAY/PLAY TONE only) /
  No action (82 00) / EFRMA ref (82 01 xx) / Custom hex; drop bogus
  Action Type / Trigger Conditions / Retry Count UI
- buildBerPcHtml(allowed): no Custom option; typeBytes tone 31 -> 20
- DISPLAY TEXT Duration control emitting 84 02 <unit> <interval>
- File list tag 12 -> 92 (CR bit set)
- Script Chaining flags 01/11/02/03 + keep-across-reset checkbox (RFM)
- ber.test.js: exact-hex tests for all above (exchange vectors)
2026-08-20 21:13:41 +03:00
catarrh 0217f8dc92 Error Action Recovery: add Action Indicator / Proactive Command / None selector per TS 102 226 §7.3.3 2026-08-20 02:04:18 +03:00
catarrh 6d8ef55398 Fix Error Action Recovery Action: extract buildBerPcHtml, fix container vs element in genBerPcValue call 2026-08-20 01:48:15 +03:00
catarrh 43242210ab Fix Error Action Recovery Action builder: append to DOM before querying 2026-08-20 01:41:09 +03:00
catarrh 53daf2c6ea Auto-connect on same-origin detection 2026-08-20 01:36:54 +03:00
catarrh 79cf003444 Fix Script Chaining selector bugs in genScriptChainingValue
Fixed all three selectors to use rowIdx from dataset.berIdx:
- 'chaining-][value="first"]' → 'chaining-{rowIdx}[value="first"]'
- 'chaining][value="intermediary"]' → 'chaining-{rowIdx}[value="intermediary"]'
- Already fixed: 'chaining]-last' → 'chaining-{rowIdx}-last'

Now bits 0/1/2 correctly set based on First/Intermediary/Last checkboxes.

Frontend: frontend/index.html
Tests: 14 Node green
2026-08-19 23:51:10 +03:00
catarrh e8a8ef3d1b Fix Script Chaining Last Script checkbox selector typo
Fixed malformed querySelector in genScriptChainingValue:
- 'chaining-]-last' → 'chaining-{rowIdx}-last'
- Last Script checkbox (bit 2) now correctly contributes to flags byte
- First+Last = 0x05, Intermediary+Last = 0x06, Last alone = 0x04

Frontend: frontend/index.html
Tests: 14 Node green
2026-08-19 23:44:33 +03:00
catarrh d75604a751 TS 102 226: Expanded Script compliance with Error Action, Script Chaining, Expanded Response
Server:
- ExpandedRemoteResponse parser for per-command results (TS 102 226 §5.2.2)
- _decode_por() tries expanded parsing first, fallback to CompactRemoteResp
- response_type indicator: 'expanded'/'compact'/'none' + per-command details

Frontend:
- Error Action TLV (tag 82): structured UI with Action Type, SW pattern builder, recovery command, retry count
- Script Chaining TLV (tag 83): First/Intermediary/Last flags, Script ID with auto-increment hints, Additional Data
- Error Action replaces old 'action indicator' dropdown (breaking change)
- genErrorActionValue()/genScriptChainingValue() encoding functions
- updateSwMaskDisplay() for visual SW pattern builder

Documentation:
- help.html/help-ru.html: Error Action, Script Chaining, Expanded Response sections

Tests:
- TestExpandedRemoteResponse: construct parsing, error handling, chaining context
- 49 Python + 14 Node tests green
2026-08-19 23:20:24 +03:00
catarrh 80a860549a v1.8.0: proactive log overhaul, Expanded Script rename, proactive view sizing
Server:
- Track all TERMINAL RESPONSEs (chain, TP, pySim auto-handler, menu-respond
  link to paused entry) with shared _build_tr/_record_tr
- Log entry ids + cmd_num; server-side decode of fetched commands and TRs
  (compact PLI port); Result CTLV extracted as tr_result/tr_result_name
- _LoggingApduTracer captures TR SW for pySim auto-handler responses
- _DefaultProactiveHandler answers PLI with editor data (no re-request)
- VERSION 1.8.0

Frontend:
- Expandable proactive log rows (click to expand, state survives re-render)
- Response section: Result name + hex, decoded fields, width-restrained
  readonly hex inputs; no SW display
- Rename Expanded Script tab/pill/button/docs; proactive UICC view font
  sizing increase; card reader pills text-sm
2026-08-19 18:04:08 +03:00
catarrh a916e8a255 PLI list: vertical layout, full descriptions, wider inputs, row separators
- Drop truncation: full qualifier descriptions (wrap)
- Raw hex input moves under the description, fills row width (flex-1)
- Subtle bottom-border separator between qualifiers
2026-08-16 00:47:06 +03:00
catarrh 62ba09d25e Probe: require JSON version field to confirm same-origin API
SPA-fallback static hosts return 200 HTML for /api/version, which falsely
triggered same-origin mode. Now validate the body parses as JSON with a string
version field before switching to a relative base.
2026-08-15 14:33:00 +03:00
catarrh 966ada21eb Replace embedded flag with same-origin API probe
- Server serves frontend verbatim (drop window.PYSIM_EMBEDDED injection)
- Frontend probes /api/version once; res.ok -> relative base + cleared URL input,
  otherwise fall back to http://127.0.0.1:8080
- sw.js: never intercept/cache /api/* (live card data)
2026-08-15 14:10:24 +03:00
catarrh 1971eca381 pyproject: restrict package discovery to pysim_otaman_server
Fix setuptools flat-layout error ('Multiple top-level packages discovered'
for frontend/ node_modules/ pysim_otaman_server/) by explicit find.include.
2026-08-14 16:02:44 +03:00
catarrh d2c292e5b8 Merge pysim-otaman-server into otaman (monorepo, v1.7.0)
- Move PWA into frontend/; server package at pysim_otaman_server/
- Server now serves the PWA (same origin -> no CORS/PNA): static file handler
  + --web-dir flag + injects window.PYSIM_EMBEDDED marker into index.html
- Frontend defaults to relative API base when embedded (pysimBase = '')
- Version 1.7.0 aligned: server.py VERSION, pyproject.toml, PWA header
- SW cache bump otaman-v7 -> otaman-v8
- Docs: combined README + docs/api.md endpoint reference; update links
- Fix stale package.json repository URL
2026-08-14 15:48:38 +03:00
catarrh 8e96c5d4a0 Reduce input field vertical padding (py-2.5->py-1.5) in C-APDU, Secured Packet, Response parser and Cards tabs 2026-08-14 14:13:30 +03:00
catarrh 05096a184a Reduce top bar height (py-4->py-2, mb-6->mb-3); rebuild Tailwind CSS 2026-08-14 13:44:02 +03:00
catarrh 65127b8cfe Show connect-phase messages in visible slot (was writing to hidden #pysim-status)
#pysim-status lives inside the hidden #pysim-connected-row, so 'Checking card…',
version warnings, and the connection-failure hint were never visible. Add
#pysim-connect-msg inside the disconnected info block and route pre-connect
messages to it.
2026-08-14 00:18:22 +03:00
catarrh a88930b7b1 Show actionable warning when card server fetch fails; fix connect-button locale
- Detect likely browser PNA/local-network block via origin-vs-target heuristic
- Show warning mentioning both causes (server down + browser block)
- Fix 'Connect' button resetting to English after failed connect (t('Connect'))
- Fix 'Connection failed:' translation never matching (trailing-space key)
2026-08-14 00:14:32 +03:00
catarrh ab78455ff6 docs: document browser local-network permission for public-hosted PWA 2026-08-13 23:59:53 +03:00
catarrh e8158fa5c4 v1.6.1: document Private Network Access for public-hosted PWA 2026-08-13 23:35:54 +03:00
catarrh 3c03b04157 Add AES-128/192/256 support to secured packet builder (v1.6.0)
- Bundle aes-js as aes-bundle.js (standalone aesjs global), precache in SW (v7)
- Add AES-CBC (zero IV, 16/24/32B) + AES-CMAC (SP 800-38B, 8-octet) helpers
- genSp(): algorithm dispatch, AES counter hard-block (b5b4 = 10/11 per Rel-18)
- Cross-checked AES vectors against pySim OtaDialectSms.encode_cmd
- Docs: AES + 3DES deprecation, fix stale SPI1 value table
2026-08-13 22:56:35 +03:00
catarrh 6e2a670fc8 Help manual: note SMPP bridge omitted on Windows 2026-08-13 22:11:26 +03:00
catarrh 65aa38dc1b Help manual: recommend Python 3.10-3.13 for pyscard wheels on Windows 2026-08-13 21:41:10 +03:00
catarrh 6418e1e37d Help manual: note pyscard precompiled wheels + C++ Build Tools fallback 2026-08-13 21:31:32 +03:00
catarrh e3b8664286 Fix disconnect message: pySim -> pysim-otaman-server 2026-08-13 21:11:34 +03:00
catarrh 925ff80d80 Add offline HTML help manual (EN/RU) with sidebar TOC + context-aware help link 2026-08-13 15:26:08 +03:00
catarrh 69a20baa9f v1.5.1 2026-08-11 23:54:46 +03:00
catarrh f764760b0a Proactive log: decode PLI response data using PLI_CODECS; hide empty Response 2026-08-11 23:26:05 +03:00
catarrh a2f7b60333 Proactive log: qualifier names for all multi-qual commands, Response line under command 2026-08-11 23:13:32 +03:00
catarrh 3b7dbf1743 Proactive log: inline TR hex, remove expand toggle + polling re-render 2026-08-11 23:05:34 +03:00
catarrh 7c5d0051d4 PWA poll loop: detect card disconnect, show 'Card disconnected' 2026-08-11 22:36:27 +03:00
catarrh 302a1f87a2 Rebuild CSS (gap-6 was purged) 2026-08-11 22:22:17 +03:00
catarrh 52bcd31387 Auto-poll toggle + PWA backend poll loop (5s) for proactive tab 2026-08-11 21:44:37 +03:00
catarrh d4f40aaaef Fix privilege byte 1 decode: add missing Mandated DAP Verification checkbox (bit 1) 2026-08-10 21:41:30 +03:00
catarrh bdf3d1a352 Remove byte count from proactive command list 2026-08-10 20:16:34 +03:00
catarrh c0784a10c6 Proactive log: show TERMINAL RESPONSE hex + SW on expand 2026-08-10 20:12:59 +03:00
catarrh 4de1bd49d8 Proactive log: expandable hex dump + decoded PLI qualifier names 2026-08-10 20:02:54 +03:00
catarrh e4ef33c097 Add Send STATUS button above event list in Proactive UICC 2026-08-10 19:53:56 +03:00
catarrh 6e460908d8 README: Proactive UICC pill features 2026-08-10 19:46:23 +03:00
catarrh ef754befab v1.5.0: PLI data dictionary, event send, rejection cause dropdown, clipboard import fix 2026-08-10 19:44:25 +03:00
catarrh f6d36aaf99 v1.4.3 2026-08-10 03:05:45 +03:00
catarrh 9608302a52 feat: Proactive UICC tab shows fetched proactive command log with type name, elapsed time, and byte count (i18n: RU) 2026-08-10 03:03:24 +03:00
catarrh b67c9cb7cc v1.4.2 2026-08-10 02:00:19 +03:00
catarrh dc5b936f91 fix: move pysim-sub-proactive into correct tab parent (pysim, not C-APDU) 2026-08-10 01:31:21 +03:00
catarrh 15804f7d99 fix: move pysim-sub-proactive from C-APDU tab to card reader sub-tabs 2026-08-10 00:55:29 +03:00
catarrh 7bcc79d859 add 'Proactive UICC' pill to Card reader tab with event list display from SET UP EVENT LIST 2026-08-10 00:40:12 +03:00
catarrh 98b24a5389 hide OK button on SELECT ITEM view, show only on DISPLAY TEXT 2026-08-09 23:40:40 +03:00