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
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: LicenseRef-Starship-1.0
# Copyright (c) 2023-2026 Robert A. James
"""capsule_unsign.py GENERATED.c NAME -- for the test only (#139): take one capsule's signature out of a
signed build's capsule_generated.c, so that a signed kernel can be seen to refuse an unsigned capsule
(docs/v4.0.0/plans/2026-11-20-capsule-trust.md, ruling 4: "Left to CI"). kernel/Makefile runs it when
CAPSULE_TEST_UNSIGN names a capsule; nothing else does. Fails if NAME is not there, or was not signed."""
import re
import sys
path, name = sys.argv[1], sys.argv[2]
text = open(path).read()
m = re.search(r"/\* \[\d+\] " + re.escape(name) + r" \*/\n(.*?)\.has_sig = (\d) \}", text, re.S)
if not m:
sys.exit("capsule_unsign: %s is not in %s" % (name, path))
if m.group(2) != "1":
sys.exit("capsule_unsign: %s is not signed in %s -- a signed build is needed" % (name, path))
start = m.start(2)
open(path, "w").write(text[:start] + "0" + text[start + 1:])
print("capsule_unsign: %s left unsigned, for the test (#139)" % name)