interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / scripts / sign_efi_binary.sh

45 lines · 1828 bytes Raw Blame History
1#!/usr/bin/env bash
2# SPDX-License-Identifier: Apache-2.0
3# Copyright 2026 Drake Stapleton (AIEN / aien-dev)
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# sign_efi_binary.sh: Signs an EFI executable with the disposable development signing key
18# DISPOSABLE DEVELOPMENT/TEST MATERIAL ONLY.
19# Invariant: This is NOT the TRUST-1 Q13 Owner Root or production Boot Signer.
20# Invariant: NO PLAINTEXT SECRETS IN REPOSITORY OR BUILD ARTIFACTS. Unslop compliant.
21
22set -euo pipefail
23
24INPUT_EFI="${1:-target/aarch64-unknown-uefi/release/aienos-handoff.efi}"
25OUTPUT_EFI="${2:-${INPUT_EFI}.signed}"
26KEY_DIR="${HOME}/.config/atlas/boot-keys/dev-only"
27KEY_FILE="${KEY_DIR}/dev_boot.key"
28CERT_FILE="${KEY_DIR}/dev_boot.crt"
29
30if [[ ! -f "${INPUT_EFI}" ]]; then
31 echo "Error: Input EFI binary not found at ${INPUT_EFI}" >&2
32 exit 1
33fi
34
35if [[ ! -f "${KEY_FILE}" || ! -f "${CERT_FILE}" ]]; then
36 echo "Error: Development keys not found in ${KEY_DIR}. Run generate_owner_boot_keys.sh first." >&2
37 exit 1
38fi
39
40echo "Signing ${INPUT_EFI} with development certificate..."
41sbsign --key "${KEY_FILE}" --cert "${CERT_FILE}" --output "${OUTPUT_EFI}" "${INPUT_EFI}"
42
43echo "Verifying signature on ${OUTPUT_EFI}..."
44sbverify --cert "${CERT_FILE}" "${OUTPUT_EFI}"
45echo "PASS: Binary successfully signed and verified with Disposable Dev Boot Key."