From f26bf8bdfbef57feec518b71ceecad6f71289275 Mon Sep 17 00:00:00 2001 From: diviocity Date: Mon, 30 Nov 2026 03:50:02 +0100 Subject: [PATCH] Check HTTPS, Git, SSH signing and XBPS inside the release kernel --- BOOTSTRAP.md | 2 ++ tests/userland/network.sh | 66 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 tests/userland/network.sh diff --git a/BOOTSTRAP.md b/BOOTSTRAP.md index dfde4ab..775c978 100644 --- a/BOOTSTRAP.md +++ b/BOOTSTRAP.md @@ -70,3 +70,5 @@ python3 tools/build-queue.py --reserve-mib 6144 "$arch" "$plan/order.tsv" "$port ``` Each port gets a fresh, signed SDK containing its transitive prerequisites. The queue records recipe and dependency hashes, compiler logs and ELF page results. A subsequent port consumes an archive after its final checksum is available. Exit status 2 reports outstanding input packages. Rerunning reuses verified outputs and reclaims interrupted scratch directories. The worker built musl-fts, resumed it, and rejected an incorrect input version and a damaged receipt in `foundation/queue-test-03`, receipt SHA-256 `1de747944bd569219494cd127fc1f42cf110f7b0ad2a4e513099249a2e0b3bb1`. Two concurrent resumptions passed in `foundation/queue-resume-04`, receipt SHA-256 `a58a80c0050294666d4ecd41ce5c2affc371c5fbeb58fc672e98a9b7c8c3b14b`. + +The published x86_64 Vinix kernel booted 32 signed network packages. It refreshed the trust store with a local CA, established loopback HTTPS, rejected the wrong hostname, committed and read a Git file, signed and verified that file with the installed SSH tools, then installed and queried a local XBPS package. The fixture and logs are `tests/userland/network.sh` and `foundation/network-guest-03`, receipt SHA-256 `4e9afac33947b999911a4ff35f218b49f3356b345e47e7b90e7ffce644d0c7b4`. diff --git a/tests/userland/network.sh b/tests/userland/network.sh new file mode 100644 index 0000000..c35a3c0 --- /dev/null +++ b/tests/userland/network.sh @@ -0,0 +1,66 @@ +#!/bin/sh +# BusyBox starts this script as the signed network packages' guest smoke test. +set -eu +export PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/tmp TERM=dumb LC_ALL=C +phase=identity +server= +finish() { + status=$? + if [ -n "$server" ]; then kill "$server" 2>/dev/null || true; fi + if [ "$status" -ne 0 ]; then echo "VPAC NETWORK FAIL at $phase with status $status"; fi + /sbin/poweroff -f +} +trap finish EXIT +test "$(uname -o)" = Vinix +mkdir -p /tmp/network +cd /tmp/network + +phase=trust +openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes -days 1 \ + -subj /CN=vinix.test -addext subjectAltName=DNS:vinix.test -keyout key.pem -out cert.pem +mkdir -p /usr/local/share/ca-certificates +cp cert.pem /usr/local/share/ca-certificates/vinix-fixture.crt +update-ca-certificates +openssl verify -CAfile /etc/ssl/cert.pem cert.pem +openssl verify -no-CAfile -no-CAstore -CApath /etc/ssl/certs cert.pem + +phase=https +openssl s_server -accept 127.0.0.1:2443 -cert cert.pem -key key.pem -www >tls.log 2>&1 & +server=$! +curl --disable --noproxy '*' --retry 5 --retry-connrefused --max-time 8 --silent --show-error \ + --resolve vinix.test:2443:127.0.0.1 https://vinix.test:2443/ -o page +grep -qi '' page +status=0 +curl --disable --noproxy '*' --max-time 5 --silent --show-error --resolve wrong.test:2443:127.0.0.1 \ + https://wrong.test:2443/ -o wrong || status=$? +test "$status" -eq 60 +kill "$server" +wait "$server" || true +server= + +phase=git +git init -q repo +printf '%s\n' 'Vinix source ports' >repo/note +git -C repo add note +git -C repo -c user.name=Vinix -c user.email=ports@example.invalid commit -qm fixture +test "$(git -C repo show HEAD:note)" = 'Vinix source ports' +git -C repo grep -q -P '(?=source)source' + +phase=ssh +ssh-keygen -q -t ed25519 -N '' -f ssh-key +ssh-keygen -Y sign -f ssh-key -n vinix repo/note +printf 'builder %s\n' "$(cat ssh-key.pub)" >signers +ssh-keygen -Y verify -f signers -I builder -n vinix -s repo/note.sig