From 4e0893923df65415d0af4a9cade19f72ab16d580 Mon Sep 17 00:00:00 2001 From: Erik Karulf Date: Fri, 13 Nov 2026 01:14:19 -0600 Subject: [PATCH] Address issue #23 --- .github/workflows/build.yml | 9 ++++++++ README.md | 3 +++ docs/RELEASING.md | 26 +++++++++++++++++++++++ scripts/validate-enclave-release.sh | 32 +++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 docs/RELEASING.md create mode 100644 scripts/validate-enclave-release.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 642b048..b900338 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -113,3 +113,12 @@ jobs: --repo "$GITHUB_REPOSITORY" --verify-tag \ --title "$GITHUB_REF_NAME" --draft --generate-notes \ "${archives[@]}" SHA256SUMS + gh release view "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --json body --jq .body > release-notes.md + cat >> release-notes.md <<'CHECKLIST' + + Hardware validation required before publication (docs/RELEASING.md): + - [ ] Attach test.json and metadata.txt from validate-enclave-release.sh. + - [ ] Confirm exact tag commit, real Apple Silicon, both roles PASS, no skips. + - [ ] Record operator and test date; link evidence in these notes. + CHECKLIST + gh release edit "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --notes-file release-notes.md diff --git a/README.md b/README.md index 05af003..46bfdf6 100644 --- a/README.md +++ b/README.md @@ -357,6 +357,9 @@ QuantumCat trusts explicitly paired device identities, not relay infrastructure. For the details and caveats, read [DESIGN.md](DESIGN.md) and [PROTOCOL.md](PROTOCOL.md). +Release publication also requires the per-commit real Apple Silicon evidence +in [the release checklist](docs/RELEASING.md). General CI does not satisfy it. + ## Project status QuantumCat is experimental. The implementation includes automated tests for authentication tampering, replay, identity/source binding, PSK freshness, forwarding policy, revocation, TCP/UDP transport, fragmentation, storage permissions, and local runtime control, but that is not a substitute for independent review. diff --git a/docs/RELEASING.md b/docs/RELEASING.md new file mode 100644 index 0000000..91c8c08 --- /dev/null +++ b/docs/RELEASING.md @@ -0,0 +1,26 @@ +# Release hardware validation + +General macOS CI tests and building qcat-se do not prove Secure Enclave +interoperability. Hosted CI is deliberately separate from this manual hardware +gate. A draft release must not be published until these steps are complete. + +1. On a supported Apple Silicon Mac with macOS 26+, check out the exact tag + commit with a clean tree. Run `bash scripts/validate-enclave-release.sh`. + This builds the intended helper and enables the real hardware test with + `QCAT_TEST_ENCLAVE=1` and its absolute `QCAT_ENCLAVE_HELPER` path. +2. Retain both generated files (`metadata.txt` and `test.json`). Metadata records + commit, OS/build, hardware, Go version, helper source and helper SHA256. + Attach them to the draft release and link them in the release notes. +3. Compare the recorded commit with the tag's resolved commit. Any change to + the release commit requires a fresh run. Record the operator and test date + in the release notes. +4. Confirm the named test passed without skipping. It executes the Enclave + client and server-signing roles: Enclave signatures verify in Go, Go server + signatures verify in the client path, and Enclave KEM decapsulation confirms + the same key as Go encapsulation. A failure, missing test, skip or unavailable + device blocks publication; ordinary CI success is not a substitute. +5. Only then manually publish the draft after reviewing checksums and artifacts. + +This is an explicit operator checklist, not an automated GitHub branch or release +protection rule. No hardware-validation result is asserted by checking in this +procedure. Do not publish without the per-commit evidence. diff --git a/scripts/validate-enclave-release.sh b/scripts/validate-enclave-release.sh new file mode 100644 index 0000000..d143904 --- /dev/null +++ b/scripts/validate-enclave-release.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Run from a clean checkout of the release commit on real Apple Silicon. +set -euo pipefail +cd "$(dirname "$0")/.." +test "$(uname -s)" = Darwin +test "$(uname -m)" = arm64 +test -z "$(git status --porcelain)" || { echo 'Hardware validation requires a clean checkout' >&2; exit 1; } +commit=$(git rev-parse HEAD) +evidence=$(mktemp -d "${TMPDIR:-/tmp}/qcat-enclave-evidence.XXXXXX") +make helper +helper="$PWD/bin/qcat-se" +export QCAT_TEST_ENCLAVE=1 QCAT_ENCLAVE_HELPER="$helper" +go test -count=1 -json -run '^TestSecureEnclaveStandardLibraryInteroperability$' ./internal/crypto/provider/se > "$evidence/test.json" +# Require an actual named test pass. Package success alone includes skips. +python3 - "$evidence/test.json" <<'PY' +import json, sys +rows = [json.loads(line) for line in open(sys.argv[1])] +name = 'TestSecureEnclaveStandardLibraryInteroperability' +results = [r['Action'] for r in rows if r.get('Test') == name] +if 'pass' not in results or 'skip' in results or 'fail' in results: + sys.exit('Missing, skipped or failed real Enclave interoperability test') +PY +{ + echo "commit: $commit" + echo "macOS: $(sw_vers -productVersion) ($(sw_vers -buildVersion))" + echo "hardware: $(sysctl -n hw.model) / $(sysctl -n machdep.cpu.brand_string)" + echo "go: $(go version)" + echo "helper SHA256: $(shasum -a 256 "$helper")" + echo "helper built by: make helper (swift/qcat-se.swift at $commit)" + echo "result: PASS (both roles, signature verification and KEM confirmation)" +} > "$evidence/metadata.txt" +echo "Hardware evidence: $evidence"