[pki] The Domi CA as a shared crate: signer interface, agent certificates, chain checks #1

Manually merged
mnovak merged 0 commits from feature/ca-crate into main 2026-11-17 12:15:58 +01:00
Owner

The Domi CA moved out of Ianitor core into this crate (Fabrica docs/32_coherence.md, T3a), so Fabrica can issue Legatus agent certificates without Ianitor.

What

  • Signer trait: the root is in Custos and signs through it (create_root, sign_intermediate); the crate never holds the root key. KeyPair implements it for intermediates, tests and the offline machine. Every signature a signer returns is checked before a certificate leaves the crate.
  • The Ianitor profile unchanged (root, intermediate, server, device; lifetimes; CSR rules; match codes; openssl profile; placeholder leaf).
  • New: a second intermediate, Fabrica Domi Agents Intermediate, and agent certificates (issue_agent from the agent's own CSR, URI urn:domi:agent:<team>:<agent>, 30 days, clientAuth).
  • verify_chain / verify_server (rustls-webpki) and verify_agent (the Domi rules: agents intermediate, agent URI) with typed errors.

Tests (first, 34): chains, expiry (leaf, intermediate, root), wrong issuer (another root with the same names, missing intermediate, self-signed, wrong intermediate), agents (device and server certificates are not agents, an agent made under Ianitor's intermediate is foreign, CSR wishes ignored, tampered and Ed25519 CSRs refused, ids checked), the signer (once per operation, impostor refused before signing, lying and declining signers caught, Ed25519 root end to end), hostile PEM/DER.

Self-review (adversarial)

  • Could a phone's device certificate pass as an agent? Same root, clientAuth: yes at the chain level, so verify_agent requires the agent URI and the agents intermediate; tested both ways.
  • Could webpki build a path through another intermediate than the one checked? verify_agent accepts exactly leaf + one intermediate and re-checks issued_by on those two.
  • Signer is synchronous: a Custos adapter blocks while the person approves. Acceptable for root operations (a root once, an intermediate a year); leaves never touch the root.
  • No CRL/OCSP: revocation of agents is the registry's (Legatus protocol), bounded by 30-day lifetimes.
  • Not verified here: a real Custos Signer (T1's signing service has no X.509-TBS format yet: handover).
The Domi CA moved out of Ianitor core into this crate (Fabrica docs/32_coherence.md, T3a), so Fabrica can issue Legatus agent certificates without Ianitor. **What** - `Signer` trait: the root is in Custos and signs through it (`create_root`, `sign_intermediate`); the crate never holds the root key. `KeyPair` implements it for intermediates, tests and the offline machine. Every signature a signer returns is checked before a certificate leaves the crate. - The Ianitor profile unchanged (root, intermediate, server, device; lifetimes; CSR rules; match codes; openssl profile; placeholder leaf). - New: a second intermediate, *Fabrica Domi Agents Intermediate*, and agent certificates (`issue_agent` from the agent's own CSR, URI `urn:domi:agent:<team>:<agent>`, 30 days, clientAuth). - `verify_chain` / `verify_server` (rustls-webpki) and `verify_agent` (the Domi rules: agents intermediate, agent URI) with typed errors. **Tests (first, 34):** chains, expiry (leaf, intermediate, root), wrong issuer (another root with the same names, missing intermediate, self-signed, wrong intermediate), agents (device and server certificates are not agents, an agent made under Ianitor's intermediate is foreign, CSR wishes ignored, tampered and Ed25519 CSRs refused, ids checked), the signer (once per operation, impostor refused before signing, lying and declining signers caught, Ed25519 root end to end), hostile PEM/DER. **Self-review (adversarial)** - Could a phone's device certificate pass as an agent? Same root, clientAuth: yes at the chain level, so `verify_agent` requires the agent URI *and* the agents intermediate; tested both ways. - Could webpki build a path through another intermediate than the one checked? `verify_agent` accepts exactly leaf + one intermediate and re-checks `issued_by` on those two. - Signer is synchronous: a Custos adapter blocks while the person approves. Acceptable for root operations (a root once, an intermediate a year); leaves never touch the root. - No CRL/OCSP: revocation of agents is the registry's (Legatus protocol), bounded by 30-day lifetimes. - Not verified here: a real Custos `Signer` (T1's signing service has no X.509-TBS format yet: handover).
mnovak added 2 commits 2026-11-17 12:14:01 +01:00
mnovak manually merged commit b1ec5b3196 into main 2026-11-17 12:15:58 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/domi-pki#1