8000 fix(bep): ask Secret Service before a TPM key removal · gominimal/minimal@e2a9f44 · GitHub
[go: up one dir, main page]

Skip to content

fix(bep): ask Secret Service before a TPM key removal

Minimal Arch / arch-review succeeded Nov 14, 2026 in 0s

PASS

Baseline. This re-reviews e2a9f440 against the PASS on f0b14a30 (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 one commit, e2a9f440 ("ask Secret Service before a TPM key removal"). git diff f0b14a30 e2a9f440 --stat agrees: crates/bep/src/linux_store.rs only, 9 lines in and 1 out. No merge is in the compare. Everything outside the compare keeps the status the baseline gave it.

Governs. Gatehouse §6.10 Hardware-backed custody, line 837: keys go in the host's hardware where the host offers it, TPM 2.0 on Linux. §6.10 un-enrolled lifecycle, line 839: keys persist across restarts and are never regenerated silently. BEP-088 and BEP-089 in the repo spec (docs/specs/24-spec-box-egress-proxy) carry these lines to Linux.

The compare. LinuxStore::remove_in now calls secret_service_holds(role, slot) before self.tpm.remove_in(role, slot). Before, a locked keyring returned KeyError::Locked only after the TPM key file and its auth file were gone. Now the error stops the removal first, and both stores keep what they hold. That is fail-closed (rubric rule 7), and it protects the line 839 rule that a held key does not go silently. An absent Secret Service (Unreachable, or no secret-tool) still answers "holds none" through secret_service_answer, unchanged from the baseline, so a headless TPM host still removes its keys (BEP-088). I read the callers in keys.rs: replace clears Slot::New and Slot::Old and maps an error to ReplaceError::Remove/RemoveNoKey. After replace moves the new key in, it removes Slot::Old and only logs an error. discard_new only logs. None of them depends on the old order. The new test lines in remove_in's test set the keyring to LOCKED, then assert that the removal errs and that the TPM still holds the Sealing key. The test proves the rule it cites and does not relax a gate (rubric rule 3).

Ruling. Both requirements still conform. No condition, residual or escalation is new. This follows the four earlier rulings on this PR and departs from none.

Not checked. I did not compile or run the tests, as the instructions require. The PR body reports exit 0 for the six task tests. The compare test is in the same module.

Ruled at e2a9f44 against gominimal/arch@15b603e6afb8 by claude-opus-5-5; arch_rulings 1282, job a7d1be2b-136b-4dd3-bb60-a3f9d036fc6e.

0