me

/

vinix-ports Public
382 commits 0 issues 0 pull requests 1 contributor Discussions Projects Snippets LOC history Platform CI

Exercise BusyBox wget trust and hostname checks in Vinix

diviocity committed 5 days ago · f1a25feafde8d98a74839464c4f17045476ccf27 View patch
Unverified signature 2 files changed +57 -0
BOOTSTRAP.md +2 -0

@@ -73,4 +73,6 @@ Each port gets a fresh, signed SDK containing its transitive prerequisites. The

7373

7474The 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`.

7575

76+An eight-package x86_64 guest tested the BusyBox wget applet and its separately packaged TLS helper. It rejected an unknown certificate, retrieved the expected bytes after installing the local CA, and rejected the same certificate for a different hostname. The guest fixture is `tests/userland/wget.sh`. The worker keeps the install, audit and serial hashes in `foundation/wget-guest-x86_64-01/receipts.sha256`, SHA-256 `5872d1467ee2594b9305bed5fa1ceb084c8c3fde4ebccb0539db25d02b3849f9`.

77+

7678For package roots too large for a test initramfs, use `python3 tests/disk-root.py "$arch" "$root" "$fixture" "$iso" "$boot" "$output"` on the worker. The root must supply BusyBox init, and the fixture prints `VPAC FIXTURE GUEST PASS` after its checks. The helper creates a fresh ext2 image file from a private copy and runs QEMU in snapshot mode. The x86_64 release kernel read the matching disk identity and relocated all 109 dynamic executable paths from a 106-package root with 512 MiB of guest RAM. The test retains its ext2 and serial hashes under `foundation/disk-exec-x86-02/test`, receipt SHA-256 `6f600855744d04fa71d916f545e746ed36ba2686a56937c2b4c3cb02e3ec6a58`.

tests/userland/wget.sh new file +55 -0

@@ -0,0 +1,55 @@

1+#!/bin/sh

2+# Exercise the release BusyBox applet and the installed TLS helper inside Vinix.

3+set -eu

4+export PATH=/bin:/usr/bin:/sbin:/usr/sbin HOME=/tmp LC_ALL=C

5+unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY SSL_CERT_FILE SSL_CERT_DIR

6+phase=identity

7+server=

8+finish() {

9+ status=$?

10+ if [ -n "$server" ]; then kill "$server" 2>/dev/null || true; fi

11+ if [ "$status" -ne 0 ]; then echo "VPAC WGET FAIL at $phase with status $status"; fi

12+ /sbin/poweroff -f

13+}

14+trap finish EXIT

15+test "$(uname -o)" = Vinix

16+test -x /usr/bin/ssl_client

17+mkdir -p /tmp/wget/empty

18+cd /tmp/wget

19+printf '\n127.0.0.1 vinix.test wrong.test\n' >>/etc/hosts

20+printf 'Signed Vinix networking packages\n' >body.txt

21+openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes -days 1 \

22+ -subj /CN=vinix.test -addext subjectAltName=DNS:vinix.test -keyout key.pem -out cert.pem

23+openssl s_server -accept 127.0.0.1:21443 -cert cert.pem -key key.pem -WWW >server.log 2>&1 &

24+server=$!

25+

26+phase=trusted-peer

27+url=https://vinix.test:21443/body.txt

28+tries=0

29+until SSL_CERT_FILE="$PWD/cert.pem" SSL_CERT_DIR="$PWD/empty" \

30+ /bin/busybox wget -T 5 -O received "$url" >client.log 2>&1; do

31+ tries=$((tries + 1))

32+ if [ "$tries" -ge 5 ]; then cat client.log server.log; exit 1; fi

33+ sleep 1

34+done

35+cmp body.txt received

36+

37+phase=untrusted-ca

38+if /bin/busybox wget -T 5 -O rejected "$url" >client.log 2>&1; then exit 1; fi

39+cat client.log

40+grep -Eiq 'certificate verify failed|certificate verification failed' client.log

41+test ! -s rejected

42+

43+phase=system-store

44+mkdir -p /usr/local/share/ca-certificates

45+cp cert.pem /usr/local/share/ca-certificates/vinix-fixture.crt

46+update-ca-certificates

47+/bin/busybox wget -T 5 -O received "$url"

48+cmp body.txt received

49+

50+phase=wrong-hostname

51+if /bin/busybox wget -T 5 -O wrong https://wrong.test:21443/body.txt >client.log 2>&1; then exit 1; fi

52+cat client.log

53+grep -Eiq 'hostname mismatch|certificate verify failed|certificate verification failed' client.log

54+test ! -s wrong

55+echo 'VPAC FIXTURE GUEST PASS'