Phase B of the identity pipeline (FABRIC-3.md §F.7/§F.17):
- x509_ed25519.c/.h: two new DER walkers alongside the existing pubkey
extractor -- x509_verify_signature() (verifies a cert's outer Ed25519
signature over the raw, exactly-as-encoded tbsCertificate bytes, real
signature verification against issuer_pubkey, rejects non-Ed25519
signatureAlgorithm) and x509_extract_serial() (extracts the
serialNumber INTEGER, stripping a DER padding byte if present, for the
drive_uuid binding decided in §F.7).
- vm_identity.c: vm_identity_from_cert(), ties the three DER primitives
together into the actual CERTVERIFY check -- signature verifies against
issuer_pubkey, serialNumber matches this drive's own drive_uuid,
subject pubkey extracts cleanly -- and populates a VMIdentity on
success. acl_caps is caller-supplied, not read from the cert (nothing
in the decided cert fields encodes capabilities); deciding what a
verified identity is allowed to do is policy for the caller (WIREBIND,
not yet built), not this function's job.
Verified two ways: a standalone host-side test harness (not part of the
kernel build) links the real source files against a real openssl-
generated Ed25519 X.509 cert -- extracted pubkey, extracted serial, and
signature verification all match ground truth, plus two negative tests
(wrong issuer pubkey, corrupted signature) both correctly rejected. Then
the actual kernel build verified live on all three architectures: clean
compile, clean boot to ok>, Hermes/Artemis both live with no KILL. Same
pre-existing, unrelated Zuse fence-write anomaly observed on all three
(not caused by this change, not chased here).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ZGkimpfyh63EZyRkNbkPD
Root CA + snakeoil intermediate generated entirely offline
(/home/rajames/CLionProjects/lithosananke-ca/, outside this repo,
private keys chmod 600) per this milestone's own requirement: Ed25519,
root self-signed 20-year validity, intermediate real-CA-signed
(CA:TRUE, pathlen:0), chain verified via openssl.
Snakeoil intermediate embedded as a capsule (capsules/pki/
snakeoil-intermediate.der) -- confirmed the font-capsule precedent
needed zero new infrastructure, any non-.4th file under capsules/
embeds verbatim already.
New x509_ed25519.c: a from-scratch, narrow DER walker (not general
ASN.1/X.509, per this milestone's design decision) extracting the raw
Ed25519 pubkey from a cert's SubjectPublicKeyInfo -- handles the
optional v3 version field, verifies the AlgorithmIdentifier OID is
Ed25519 rather than assuming, handles both DER length forms. Verified
against ground truth: the extracted key from the real embedded cert
matches openssl's own reported pubkey byte-for-byte; refusal path
checked against truncated/garbage/empty/wrong-algorithm (real RSA cert)
input. Compiles clean on all three architectures.
Still open: mkcapsule signing step, wiring ed25519_verify() into
capsule_birth.c's three validate call sites (landing warn-only first,
per decision -- a bug here could stop every capsule from birthing,
including Mama's own, on all three arches), and the BLOCK_MAP.md
signature-status column. Documented in FABRIC-3.md.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U14ET9CWAtbQMbYqomKgXd