capsule trust: a signed kernel refuses an unsigned capsule; the intermediate is the anchor (#139)

capsule_sig_refused(), the one decision at v4's boot and v3's three
births: INVALID always; MISSING and NO_ROOT_KEY on a signed build
(CAPSULE_SIGNED_BUILD, set exactly when the Makefiles sign). A
developer build warns and boots. test_capsule_sig, built both ways,
did not build without it; 4 checks each way now. nightly.sh
capsule-trust, a nightly step: signed, v4:centre.4th left unsigned
(test only), amd64 must refuse it -- CI's, as ruled, since only CI has
the key. No root check, as ruled; the step-4 trust model (blobs signed
by their authors, MANIFEST.md hashes, contributors' intermediates,
snakeoil) recorded as given. FABRIC-3 XLIX. Gates pass, POST 992/992.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
Claude
2026-11-20 22:37:25 +00:00
parent 5425d52cb1
commit 9db364f7c7
20 changed files with 1750 additions and 11 deletions
+21 -2
View File
@@ -189,6 +189,13 @@ elif a.no_zuse or a.mode in NO_ZUSE_MODES:
if a.mode == "v3_keys":
make_args.append(f"ARTDISK={art}") # v3's Artemis is the virtio disk
make_args += shlex.split(a.make)
if a.mode == "unsigned_capsule":
# #139 (plan 2026-11-20-capsule-trust.md, ruling 4: "Left to CI"): a signed build with one capsule's
# signature taken out, which the kernel must refuse -- needs the signing key, as CI has it
if not (os.environ.get("SIGN_KEY") and os.path.isfile(os.environ["SIGN_KEY"])):
print("unsigned_capsule needs SIGN_KEY, the capsule-signing key (CI's CAPSULE_SIGN_KEY)", flush=True)
sys.exit(2)
make_args.append("CAPSULE_TEST_UNSIGN=v4:centre.4th")
if a.mode in ("v3_keys", "stick_v3"):
make_args.append("KERNEL_ARGS=system=v3")
if a.mode == "screen_boot":
@@ -612,8 +619,17 @@ def births():
wait_for(PROMPT, 120, n) and count(r"Stadium conservation: CONSERVED") > c and "ERROR" not in text()[-300:])
check("POST: PASSED", wait_for(r"POST: PASSED", 900))
m = a.mode
if a.mode == "unsigned_capsule":
# the signed kernel refuses the capsule left unsigned, and the boot stops there (#139)
check("a signed kernel refuses an unsigned capsule: v4:centre.4th, missing",
wait_for(r"V4: capsule v4:centre\.4th signature: missing \(unsigned\)", 900))
check("and the boot stops there: POST: FAILED, and no prompt for 60 s",
wait_for(r"POST: FAILED", 120) and not wait_for(ANYPROMPT, 60))
check("no capsule loaded after it", count(r"PARITY:V4_CAPSULE name=v4:centre\.4th") == 0)
m = "unsigned_capsule_checked"
else:
check("POST: PASSED", wait_for(r"POST: PASSED", 900))
m = a.mode
if m == "headless":
check("no ok> for 60 s after POST", not wait_for(ANYPROMPT, 60))
@@ -1360,6 +1376,9 @@ elif m in ("gpt_zuse", "gpt_hotplug", "gpt_foreign", "gpt_bad_crc", "gpt_bad_ent
check("no identity", count(r"Zuse: identity confirmed") == 0)
check(f"not attached (blk: lines {b0} -> {blk_lines()})", blk_lines() == b0)
elif m == "unsigned_capsule_checked":
pass # its checks are above, where POST would have passed
else:
check(f"known mode {m}", False)