6 Commits

Author SHA1 Message Date
73b9ab4515 Fix N2: agent_keys history keeps checkpoints verifiable after revoke
Permanent revoke and rekey retired the live pubkey without retaining it,
so historical checkpoints and off-box anchors became permanently
unverifiable. Add append-only agent_keys (public material only); retire
on revoke/rekey; verify against the fingerprint-named historical key.
Document a dedicated checkpoint-signer identity in the runbook.
2026-10-06 06:22:13 +08:00
7872bd92b9 Fix R4: checkpoint requires private key match enrolled fingerprint
checkpoint() only checked that the signer name was enrolled, so a stranger
key could write a polluting checkpoint row. Refuse unless the private key's
fingerprint equals the enrolled fingerprint for that signer.
2026-10-06 06:14:00 +08:00
b49d2087d6 Fix R3: permanent revoke clears key; reinstate requires rekey
DESIGN claimed permanent revoke meant dead until re-enrol, but reinstate
restored the same compromised public key. Permanent revoke now wipes
pubkey/fingerprint; reinstate lifts ban flags only. Timed suspend keeps
the key. Compromise recovery may bootstrap+rekey while still revoked,
then reinstate. Regression tests cover reinstate-alone and timed path.
2026-10-06 06:13:23 +08:00
23cc531711 Fix R2: bootstrap hygiene — one live seed, clear siblings on enrol
Unspent bootstrap secrets accumulated and remained usable for enrol_rekey
after enrol. put_bootstrap now spends prior unspent seeds for the agent
(one live secret), and successful enrol / enrol_rekey clear any siblings.
Regression tests cover leftover-after-enrol, one-live-secret, and
leftover-after-rekey.
2026-10-06 06:12:24 +08:00
leora
35fc6373a6 Close three review blockers: rekey, dual-enrol race, redeem quotas
- put_agent is INSERT OR IGNORE (enrol create-if-absent); update_agent_key
  preserves revocation columns so rekey cannot un-revoke
- enrol_rekey and seed_bootstrap refuse while the agent is revoked
- redeem_code uses per-agent code_redeem / code_redeem_fail; anonymous
  guesses no longer lock valid codes for other agents
- remove dead duplicate revoke_agent; tests for each finding (111 total)

Do not merge to main yet: independent crypto review, off-box chain head,
sealed store, and platform glue still open.
2026-10-05 23:27:33 +08:00
9ce8da7573 One test per finding in the second review pass 2026-10-05 21:51:18 +08:00