aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
GitHub aien-dev/aienux#49 (code only)
Apply it
git checkout -b patch-de033fe9204db6c7 2442e9738590d1e12f4f6f8ff9cd9b8f91d6af83 curl -fsSL https://interplane.io/drakestapleton/aienux/patches/de033fe9204db6c7.patch | git am
Provenance
github-import 1
aien-dev/aienux
49
12e6e932bf6ed10d8cead2a077ee8564af1e31ac
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":49,"url":"https://github.com/aien-dev/aienux/pull/49","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:32Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/scripts/generate_owner_boot_keys.sh b/scripts/generate_owner_boot_keys.sh new file mode 100755 index 00000000..9cb9bca8 --- /dev/null +++ b/scripts/generate_owner_boot_keys.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# generate_owner_boot_keys.sh: Generates disposable development/test MOK signing key +# DISPOSABLE DEVELOPMENT/TEST MATERIAL ONLY. +# Invariant: This is NOT the TRUST-1 Q13 Owner Root or production Boot Signer. +# The production root of trust requires an air-gapped offline ceremony (Gate 3). +# Keys generated here are strictly for local development and test MOK database enrollment. +# Invariant: NO PLAINTEXT SECRETS IN REPOSITORY OR BUILD ARTIFACTS. Unslop compliant. + +set -euo pipefail + +KEY_DIR="${1:-$HOME/.config/atlas/boot-keys/dev-only}" +mkdir -p "$KEY_DIR" +chmod 700 "$KEY_DIR" + +KEY_FILE="$KEY_DIR/dev_boot.key" +CERT_FILE="$KEY_DIR/dev_boot.crt" +DER_FILE="$KEY_DIR/dev_boot.der" + +if [[ -f "$KEY_FILE" && -f "$CERT_FILE" ]]; then + echo "Development boot keys already exist in $KEY_DIR." +else + echo "Generating disposable development RSA 4096-bit signing key..." + openssl req -new -x509 -newkey rsa:4096 -nodes -days 365 \ + -keyout "$KEY_FILE" -out "$CERT_FILE" \ + -subj "/CN=AIENOS Disposable Dev Boot Key/O=AIEN/C=US/" + chmod 600 "$KEY_FILE" + chmod 644 "$CERT_FILE" + + openssl x509 -in "$CERT_FILE" -outform DER -out "$DER_FILE" + echo "Generated $CERT_FILE and $DER_FILE" +fi + +FINGERPRINT=$(openssl x509 -in "$CERT_FILE" -noout -fingerprint -sha256) +echo "Development Boot Key SHA-256 Fingerprint: $FINGERPRINT" +echo "Public DER certificate for test MOK enrollment at: $DER_FILE" diff --git a/scripts/sign_efi_binary.sh b/scripts/sign_efi_binary.sh new file mode 100755 index 00000000..3c0faa32 --- /dev/null +++ b/scripts/sign_efi_binary.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# sign_efi_binary.sh: Signs an EFI executable with the disposable development signing key +# DISPOSABLE DEVELOPMENT/TEST MATERIAL ONLY. +# Invariant: This is NOT the TRUST-1 Q13 Owner Root or production Boot Signer. +# Invariant: NO PLAINTEXT SECRETS IN REPOSITORY OR BUILD ARTIFACTS. Unslop compliant. + +set -euo pipefail + +INPUT_EFI="${1:-target/aarch64-unknown-uefi/release/aienos-handoff.efi}" +OUTPUT_EFI="${2:-${INPUT_EFI}.signed}" +KEY_DIR="${HOME}/.config/atlas/boot-keys/dev-only" +KEY_FILE="${KEY_DIR}/dev_boot.key" +CERT_FILE="${KEY_DIR}/dev_boot.crt" + +if [[ ! -f "${INPUT_EFI}" ]]; then + echo "Error: Input EFI binary not found at ${INPUT_EFI}" >&2 + exit 1 +fi + +if [[ ! -f "${KEY_FILE}" || ! -f "${CERT_FILE}" ]]; then + echo "Error: Development keys not found in ${KEY_DIR}. Run generate_owner_boot_keys.sh first." >&2 + exit 1 +fi + +echo "Signing ${INPUT_EFI} with development certificate..." +sbsign --key "${KEY_FILE}" --cert "${CERT_FILE}" --output "${OUTPUT_EFI}" "${INPUT_EFI}" + +echo "Verifying signature on ${OUTPUT_EFI}..." +sbverify --cert "${CERT_FILE}" "${OUTPUT_EFI}" +echo "PASS: Binary successfully signed and verified with Disposable Dev Boot Key."