8000 fix(bep): sweep stale TPM temporary files with the work dirs · gominimal/minimal@6110ebb · GitHub
[go: up one dir, main page]

Skip to content

fix(bep): sweep stale TPM temporary files with the work dirs

Minimal Arch / arch-review completed Nov 13, 2026 in 0s

PASS_WITH_CONDITIONS

Baseline. This re-reviews 6110ebba against the PASS_WITH_CONDITIONS on 5cc0514d (this PR), on arch 15b603e6. The checkout has no arch-map.md, so I found the sections by search, as the earlier rulings did. since.diff is a merge of main (1046e99a, which brings 865e85ea) and one commit, 6110ebba. git show --cc 1046e99a shows no conflict edits, and the merge touches no crates/bep file. pr.diff does not carry it. The ruling on 5cc0514d stands for everything the compare does not touch.

Governs. Gatehouse §6.10 line 837: the helper's long-lived keys SHOULD be generated non-exportable in TPM 2.0 on Linux, P-256 for sealing (ECDH-ES) and for the CA (ECDSA). Line 832: the sealing key is hardware-backed and never inside a VM. Spec 24 lines 1208-1213 and the invariant at line 1292 read the key policy's 'process identity' on Linux as the proxy's OS user, enforced by a 0600 auth file. Principle 7 (architecture.md line 337): safe by default.

Ruling. 6110ebba widens sweep_work_dirs in crates/bep/src/tpm.rs to remove <file>.tmp-<pid> files whose process is gone. The suffix matches write_private (line 724), the sweep runs only in the store's 0700 directory, a live pid keeps its file, and the new unit test a_stale_temporary_auth_file_is_swept_when_the_store_opens_a_key pins all three cases. This conforms and removes a stray copy of an auth value. BEP-088 conforms for the TPM store this task owns. The one open item is unchanged from the baseline: the TPM proof is a deferred, not-run leg (rubric rule 4), so C1 asks for it to run on the tpm lane or be filed.

Not checked. The ledger cuts the baseline's text at 400 characters, so I could not read its conditions word for word. I rebuilt the open item from the PR body's Deferred table and the code. I did not run the TPM leg or any build. No findings.json was staged.

Conditions

  • C1: Run the deferred tpm-lane leg at this head: BEP_TPM_TCTI=swtpm:host=localhost,port=2321 cargo nextest run -p bep --run-ignored ignored-only a_tpm_key_is_fixed_exempt_from_lockout_and_needs_its_authorization (crates/bep/tests/key_store_tpm_integration.rs). Record its exit and tail in the PR's Proof section. Until it passes, the claim that the keys are generated non-exportable in the TPM and that the tpm2-tools argument shapes are correct is not observed. If the lane cannot run before merge, file an issue for the leg and link it from the PR as a residual.

Ruled at 6110ebb against gominimal/arch@15b603e6afb8 by claude-opus-5-5; arch_rulings 1254, job dba87ed5-87a3-497c-99f4-0aede132a382.

0