id: ffacef8cd9ba4582b2e38c4a7ca0af8b
parent_id: 2366e3a4ba57427e91ac354360f731b8
item_type: 1
item_id: bb3506f46ead40df8a7f965a73339928
item_updated_time: 1786710322149
title_diff: "[]"
body_diff: "[{\"diffs\":[[0,\"14 1\"],[-1,\"2:45 (final audit committed: aa2fc9e)\\\n\\\n## KLMS Meeting Agenda (today ~13:10) — Private Key Encryption\"],[1,\"4:05 (audit round 5 committed: aabf7b6, pushed to origin)\\\n\\\n## KLMS Team Action Required (external — unchanged)\"],[0,\"\\\n\\\n**\"]],\"start1\":64,\"start2\":64,\"length1\":109,\"length2\":118},{\"diffs\":[[0,\"0), \"],[-1,\"parse DER, scan for `04 20` to extract the 32-byte scalar, \"],[1,\"extract the 32-byte scalar via the shared `kf_source::extract_ec_scalar` helper,\\\n\"],[0,\"re-e\"]],\"start1\":815,\"start2\":815,\"length1\":67,\"length2\":89},{\"diffs\":[[0,\"the same\"],[-1,\"\\\n\"],[1,\" \"],[0,\"S-DEK (A\"]],\"start1\":916,\"start2\":916,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"e the EC\"],[-1,\"\\\n  \"],[0,\" scalar \"]],\"start1\":1523,\"start2\":1523,\"length1\":19,\"length2\":16},{\"diffs\":[[0,\"er UUID;\"],[-1,\"\\\n \"],[0,\" we have\"]],\"start1\":1688,\"start2\":1688,\"length1\":18,\"length2\":16},{\"diffs\":[[0,\"bkey PEM\"],[-1,\"\\\n \"],[0,\" (`data/\"]],\"start1\":1839,\"start2\":1839,\"length1\":18,\"length2\":16},{\"diffs\":[[0,\"ired in\\\n\"],[1,\"- Container payload checksum: parsed but never validated — algorithm for header checksum-algorithm values 0x00-0x03 is unspecified; need the spec to wire verification\\\n\"],[0,\"- TLS: `\"]],\"start1\":1934,\"start2\":1934,\"length1\":16,\"length2\":183},{\"diffs\":[[0,\"→ we run\"],[-1,\"\\\n \"],[0,\" `danger\"]],\"start1\":2180,\"start2\":2180,\"length1\":18,\"length2\":16},{\"diffs\":[[0,\"rt/chain\"],[1,\" (C1)\"],[0,\"\\\n- `repo\"]],\"start1\":2245,\"start2\":2245,\"length1\":16,\"length2\":21},{\"diffs\":[[0,\"dy\\\n\\\n\"],[-1,\"## KLMS Team Action Required\\\n\\\n\"],[0,\"| # \"]],\"start1\":2350,\"start2\":2350,\"length1\":38,\"length2\":8},{\"diffs\":[[0,\"see \"],[-1,\"agenda \"],[0,\"abov\"]],\"start1\":2526,\"start2\":2526,\"length1\":15,\"length2\":8},{\"diffs\":[[0,\" KLMS |\\\n\"],[1,\"| — | Container checksum algorithm unspecified | Spec so verification can be wired |\\\n\"],[0,\"| — | `r\"]],\"start1\":2739,\"start2\":2739,\"length1\":16,\"length2\":101},{\"diffs\":[[0,\" SELECTs\"],[1,\" (now via `builders::select(None/Some)`)\"],[0,\" |\\\n| — |\"]],\"start1\":3454,\"start2\":3454,\"length1\":16,\"length2\":56},{\"diffs\":[[0,\"mented |\"],[1,\"\\\n| — | ProvisionResult/ProdResult/ValidateResult mirrors | Dev/prod pipelines evolve independently |\"],[0,\"\\\n\\\n## Ref\"]],\"start1\":3581,\"start2\":3581,\"length1\":16,\"length2\":116},{\"diffs\":[[0,\"ed**\"],[-1,\" — run_production, StationApp::update, run_klms_auto_provision_inner, Provisioner/KlmsProvisioner (shared `deliver_payload`)\"],[0,\" |\\\n|\"]],\"start1\":3887,\"start2\":3887,\"length1\":132,\"length2\":8},{\"diffs\":[[0,\"\\\n## \"],[-1,\"D\"],[1,\"Audit round 5 (aabf7b6, 2026-08-14) — d\"],[0,\"eferred \"],[-1,\"P\"],[1,\"p\"],[0,\"olish \"],[-1,\"(non-blocking, next audit)\\\n\\\n| # | Item |\\\n|---|------|\\\n| M6 | Scp03SetupError/ResetError/FactoryError are clones of HandshakeError — unify |\\\n| M11 | Mock applet C-MAC verify block duplicated ×3 — extract helper |\\\n| M17' | ProdMsg progress is stringly-typed (\\\"in progress\\\"/\\\"FAILED\\\") — typed enum\"],[1,\"CLOSED\\\n\\\nAll six deferred findings confirmed still present by fresh audit, then fixed:\\\n\\\n| # | Item | Resolution |\\\n|---|------|------------|\\\n| M6 | Scp03SetupError/ResetError/FactoryError clones of HandshakeError | Unified: `Scp03SetupError = Handshake(#[from], transparent) + CardRejected`; ResetError/FactoryError wrap `Setup(#[from])` + Transport/Scp03; fabricated 6A80 conversion deleted |\\\n| M7 | Host-challenge RNG ×3 | Single `handshake::random_host_challenge()`; used by provisioner, KLMS exchange, dev-station readers (32-byte GA challenge stays separate — different semantic) |\\\n| M11 | Mock applet C-MAC block ×4 | Extracted `verify_trailing_c_mac()` in kf-transport applet.rs |\\\n| M17' | Stringly-typed progress | New `progress::StepStatus { Started/Done/Failed(detail) }` on all worker→UI channels; `DONE_STATUSES` allowlist and string matching deleted\"],[0,\" |\\\n|\"]],\"start1\":3930,\"start2\":3930,\"length1\":317,\"length2\":922},{\"diffs\":[[0,\" L15 | 1\"],[-1,\"0\"],[1,\"2\"],[0,\" inline \"]],\"start1\":4852,\"start2\":4852,\"length1\":17,\"length2\":17},{\"diffs\":[[0,\"ECT \"],[-1,\"APDU \"],[0,\"cons\"]],\"start1\":4872,\"start2\":4872,\"length1\":13,\"length2\":8},{\"diffs\":[[0,\"ons \"],[-1,\"— add \"],[1,\"| `kf_apdu::\"],[0,\"buil\"]],\"start1\":4886,\"start2\":4886,\"length1\":14,\"length2\":20},{\"diffs\":[[0,\"lect\"],[-1,\" |\\\n| L12 | kf-klms has zero in-crate tests |\\\n| M7 | Host-challenge RNG duplicated (generate_host_challenge / inline / _pub) |\"],[1,\"(Option<&[u8]>)` + `CLA_ISO`/`ins::SELECT`; all sites migrated |\\\n| L12 | kf-klms zero tests | 3 tests: unknown OEF rejection, wrong cryptogram rejection, session-key/host-cryptogram consistency + cert population |\\\n\\\nAdditional fixes from the same audit:\\\n\\\n- **Fail-closed validation paths**: `run_hardware` reconnect failure now fails the run (was silently skipping signature validation); `run_klms_provision_on_channel` validation error now sets success=false (was reporting success with error set); prod-panel tracker update keyed off the updated step instead of `last()` (SCP03-authenticate step no longer stuck IN PROGRESS)\\\n- **KLMS field extraction tag-keyed**: session keys, private key, plain-field map and logging now match `TlvTag` variants via `container_parser::field_by_tag` (reordered/extended containers can no longer silently mis-map); `KLMS_FIELD_NAMES` string table deleted\\\n- **EC-scalar dedup**: worker uses `kf_source::extract_ec_scalar` (now pub)\\\n- **Panic-safe workers**: catch_unwind in spawn_hardware/spawn_hw_applet_reset/spawn_validate/spawn_production; UI polls handle channel Disconnected → UI can no longer spin forever\\\n- **container_parser hardening**: RSA block_len<32 underflow guard; ASN.1 BIT STRING bs_len bounds check\\\n- **applet_reset pre-check**: GET STATUS errors reported with real reason (was masking transport errors as \\\"not supported\\\")\\\n- **HandshakeError::MalformedResponse now carries the parse message** (was discarding detail)\\\n- **Deps removed**: kf-dev-station: rustls, rustls-pemfile, webpki-roots, pkcs12, pcsc; kf-provision: zeroize, pcsc dev-dep, dup hex dev-dep. `Key24` deleted from kf-crypto\\\n- Hand-rolled audit JSON → serde_json::json!; doc typo length(20)→length(0x20)\\\n\\\n## Remaining open (ours, low priority)\\\n\\\n- Container payload checksum not validated (blocked on KLMS algorithm spec — moved to external table)\\\n- `danger_accept_invalid_certs(true)` stays until C1 CA fix lands\"],[0,\"\\\n\\\n##\"]],\"start1\":4914,\"start2\":4914,\"length1\":133,\"length2\":1937},{\"diffs\":[[0,\"t aa\"],[-1,\"2fc9e\"],[1,\"bf7b6\"],[0,\")\\\n\\\n-\"]],\"start1\":6876,\"start2\":6876,\"length1\":13,\"length2\":13},{\"diffs\":[[0,\") — \"],[-1,\"dead code\\\n  cfg-gated per feature; FFI unsafe silenced with module-level SAFETY note\"],[1,\"the pre-existing\\\n  minimal-variant `needless_return` in app.rs was also fixed\"],[0,\"\\\n- c\"]],\"start1\":6964,\"start2\":6964,\"length1\":92,\"length2\":85},{\"diffs\":[[0,\"an, \"],[1,\"**9\"],[0,\"9\"],[-1,\"4\"],[0,\" tes\"]],\"start1\":7105,\"start2\":7105,\"length1\":10,\"length2\":12},{\"diffs\":[[0,\"sts pass\"],[1,\"** (was 94)\"],[0,\"\\\n- KLMS \"]],\"start1\":7116,\"start2\":7116,\"length1\":16,\"length2\":27},{\"diffs\":[[0,\"low \"],[-1,\"HW-veri\"],[1,\"unchanged behaviorally (\"],[0,\"fie\"],[1,\"l\"],[0,\"d \"],[-1,\"end-to-end (retry-on-failure + re-install works)\\\n- Session keys/private scalar redacted in logs; encrypted private key shown\"],[1,\"mapping is now tag-based; HW re-validation recommended\\\n  before next production run)\"]],\"start1\":7144,\"start2\":7144,\"length1\":140,\"length2\":118}]"
metadata_diff: {"new":{},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-08-14T12:30:00.827Z
created_time: 2026-08-14T12:30:00.827Z
is_locked: 0
type_: 13