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
28 lines
1.4 KiB
C
28 lines
1.4 KiB
C
/* SPDX-License-Identifier: LicenseRef-Starship-1.0
|
|
* Copyright (c) 2023-2026 Robert A. James
|
|
*/
|
|
/* test_capsule_sig.c -- which capsule signature results the kernel refuses (#139;
|
|
* docs/v4.0.0/plans/2026-11-20-capsule-trust.md, ruled 2026-11-20): capsule_sig_refused(), the one
|
|
* decision every caller asks. INVALID is refused on every build. A signed build (built with the
|
|
* signing key, CAPSULE_SIGNED_BUILD 1) also refuses MISSING and NO_ROOT_KEY; a build without the key
|
|
* warns of them and boots. Built twice: as here, unsigned, and as test_capsule_sig_signed.c.
|
|
*/
|
|
#include "harness.h"
|
|
#include "starkernel/capsule_sig.h"
|
|
|
|
#ifndef CAPSULE_SIGNED_BUILD
|
|
#define CAPSULE_SIGNED_BUILD 0
|
|
#endif
|
|
|
|
int main(void)
|
|
{
|
|
printf("capsule_sig_refused, a %s build\n", CAPSULE_SIGNED_BUILD ? "signed" : "developer (unsigned)");
|
|
CHECK(!capsule_sig_refused(CAPSULE_SIG_OK), "a good signature is never refused");
|
|
CHECK(capsule_sig_refused(CAPSULE_SIG_INVALID), "a signature that does not verify is always refused");
|
|
CHECK(capsule_sig_refused(CAPSULE_SIG_MISSING) == CAPSULE_SIGNED_BUILD,
|
|
"an unsigned capsule: refused on a signed build, warned of on a developer build");
|
|
CHECK(capsule_sig_refused(CAPSULE_SIG_NO_ROOT_KEY) == CAPSULE_SIGNED_BUILD,
|
|
"no signing certificate to check by: refused on a signed build, warned of on a developer build");
|
|
return DONE();
|
|
}
|