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:
@@ -593,7 +593,7 @@ CapsuleRunResult capsule_birth_mama(
|
||||
if (sr != CAPSULE_SIG_OK) {
|
||||
log_message(LOG_WARN, "capsule sig: %s: %s",
|
||||
names[idx].name, capsule_sig_result_str(sr));
|
||||
if (sr == CAPSULE_SIG_INVALID) return CAPSULE_RUN_ERR_INVALID;
|
||||
if (capsule_sig_refused(sr)) return CAPSULE_RUN_ERR_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ CapsuleRunResult capsule_birth_baby(
|
||||
if (sr != CAPSULE_SIG_OK) {
|
||||
log_message(LOG_WARN, "capsule sig: %s: %s",
|
||||
names[idx].name, capsule_sig_result_str(sr));
|
||||
if (sr == CAPSULE_SIG_INVALID) return CAPSULE_RUN_ERR_INVALID;
|
||||
if (capsule_sig_refused(sr)) return CAPSULE_RUN_ERR_INVALID;
|
||||
}
|
||||
/* FABRIC-2.md §I.5: contrib trust tier -- see contrib_capsule_
|
||||
* refused()'s own doc comment. */
|
||||
@@ -940,7 +940,7 @@ CapsuleRunResult capsule_run_experiment(
|
||||
if (sr != CAPSULE_SIG_OK) {
|
||||
log_message(LOG_WARN, "capsule sig: %s: %s",
|
||||
names[idx].name, capsule_sig_result_str(sr));
|
||||
if (sr == CAPSULE_SIG_INVALID) return CAPSULE_RUN_ERR_INVALID;
|
||||
if (capsule_sig_refused(sr)) return CAPSULE_RUN_ERR_INVALID;
|
||||
}
|
||||
/* FABRIC-2.md §I.5: contrib trust tier -- see contrib_capsule_
|
||||
* refused()'s own doc comment. */
|
||||
|
||||
@@ -67,3 +67,14 @@ const char *capsule_sig_result_str(CapsuleSigResult result) {
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
int capsule_sig_refused(CapsuleSigResult result)
|
||||
{
|
||||
switch (result) {
|
||||
case CAPSULE_SIG_OK: return 0;
|
||||
case CAPSULE_SIG_INVALID: return 1;
|
||||
case CAPSULE_SIG_MISSING:
|
||||
case CAPSULE_SIG_NO_ROOT_KEY: return CAPSULE_SIGNED_BUILD;
|
||||
}
|
||||
return 1; /* not a result this code knows: refused */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user