signify: a root key signs the release key, the release key signs a release

Konrad, 2026-11-16: the master key model.  The root key stays offline with
Konrad and signs release keys only; the release key (0.99) signs the SHA512
of a release.  Rotation is a new release key plus one signature by the root
key, not a new root.

- src/etc/signify/makronix-root.pub and makronix-0.99.pub.sig are installed
  next to the release key (etc set, etc-sys-etc); the private root and
  release keys are outside the tree (SIGNIFY_ROOT_SECKEY, SIGNIFY_SECKEY).
- tools/sign-release.sh: sign, verify (checks root -> release key -> file)
  and sign-key (root signs a new release public key).
- GOAL.md names the chain.

Measured: sign-key with the root key produces the same Ed25519 signature;
verify prints "signed by the root key" and "good signature" for a signed
test file.
This commit is contained in:
lotherk committed 2026-11-16 09:58:57 +00:00
1 parent 8482e357d0
commit a5ee20710d
6 files changed
+41 -12

No files matched your search

+7 -4
View File
@@ -124,10 +124,13 @@ Baum und liegt in `/usr/src`; kein `/usr/xsrc`, kein `/usr/msrc`.
Entschieden (Konrad, 2026-11-16), nach Vorlage der offenen Punkte:
- **Update-Signatur:** eigener signify-Schlüssel. Der private Schlüssel
bleibt bei Konrad, offline; der öffentliche liegt als
`/etc/signify/makronix-0.99.pub` im System. `make release` signiert die
`SHA512` der Sets; die Paketliste des Mediums wird im selben Lauf signiert.
- **Update-Signatur:** zwei signify-Schlüssel in einer Kette. Der
**Root-Schlüssel** (`makronix-root.sec`) bleibt offline bei Konrad und
signiert nur die Release-Schlüssel; der **Release-Schlüssel**
(`makronix-0.99.sec`, pro Release bzw. jaehrlich erneuerbar) signiert die
`SHA512` der Sets und die Paketliste des Mediums. Im System liegen
`/etc/signify/makronix-root.pub`, `makronix-0.99.pub` und dessen
Root-Signatur `makronix-0.99.pub.sig`.
- **makronix-Set:** die Pakete werden als Binaerpakete aus dem
Medium-Repository mit `pkg_add` installiert, nicht als unregistrierte
Dateien (dann sehen `pkg_info`, `pkg_add -u` und `pkg_admin audit` sie).
+2
View File
@@ -367,6 +367,8 @@
./etc/shrc etc-util-etc
./etc/signify etc-sys-etc
./etc/signify/makronix-0.99.pub etc-sys-etc
./etc/signify/makronix-0.99.pub.sig etc-sys-etc
./etc/signify/makronix-root.pub etc-sys-etc
./etc/skel/.cshrc etc-sys-etc
./etc/skel/.login etc-sys-etc
./etc/skel/.logout etc-sys-etc
+1 -1
View File
@@ -8,7 +8,7 @@
.include <bsd.own.mk>
CONFIGFILES= makronix-0.99.pub
CONFIGFILES= makronix-root.pub makronix-0.99.pub makronix-0.99.pub.sig
FILESDIR= /etc/signify
FILESMODE= 644
+2
View File
@@ -0,0 +1,2 @@
untrusted comment: verify with makronix-root.pub
RWRp581tt5FeS0le4nf4t2ptylyIaUa+nT8JTBvc5hzz6rprNc8mBvYrAfU/YxlNL7wAYhtngHQAVSTIl0boqUHVRqieVr5O4w0=
+2
View File
@@ -0,0 +1,2 @@
untrusted comment: Makronix release ROOT key (offline, signs release keys) public key
RWRp581tt5FeS7WDffTmII729vcgjyBzobXdfuHT8tW4bCd5RKdnMf+H
+27 -7
View File
@@ -1,14 +1,19 @@
#!/bin/sh
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
# sign-release.sh -- the signify signature of a release.
# sign-release.sh -- the signify signature of a release, in a chain.
#
# usage: sign-release.sh sign FILE...
# sign-release.sh verify FILE...
# sign-release.sh sign-key RELEASE-PUBKEY
#
# sign: writes FILE.sig next to every FILE. The private key is named by
# SIGNIFY_SECKEY and is never in the tree (GOAL.md, 2026-11-16).
# verify: checks FILE.sig with the public key, /etc/signify/makronix-0.99.pub
# by default (SIGNIFY_PUBKEY overrides).
# The root key signs the release key once; the release key signs the files of
# a release. The root key is offline and never in the tree: sign-key takes
# its path from SIGNIFY_ROOT_SECKEY. The release key takes its path from
# SIGNIFY_SECKEY.
#
# verify checks the chain first: /etc/signify/makronix-root.pub against
# /etc/signify/makronix-0.99.pub.sig (SIGNIFY_ROOT_PUBKEY, SIGNIFY_PUBKEY
# override), then FILE.sig against the release key.
#
# What is signed: RELEASEDIR/source/sets/SHA512 (the SHA512 of the sets) and
# the medium's package list (RELEASEDIR/.../binary/packages/pkg_summary.gz or
@@ -29,7 +34,7 @@ die()
SIGNIFY=$(command -v signify 2>/dev/null || command -v signify-openbsd 2>/dev/null) \
|| die "no signify (security/signify)"
[ $# -ge 2 ] || die "usage: $0 sign|verify FILE..."
[ $# -ge 2 ] || die "usage: $0 sign|verify|sign-key ARG..."
cmd=$1
shift
@@ -44,9 +49,24 @@ sign)
echo "sign-release: $f.sig"
done
;;
sign-key)
[ $# -eq 1 ] || die "usage: $0 sign-key RELEASE-PUBKEY"
[ -n "${SIGNIFY_ROOT_SECKEY:-}" ] || die "SIGNIFY_ROOT_SECKEY is not set"
[ -r "$SIGNIFY_ROOT_SECKEY" ] || die "cannot read $SIGNIFY_ROOT_SECKEY"
[ -f "$1" ] || die "no $1"
"$SIGNIFY" -S -s "$SIGNIFY_ROOT_SECKEY" -m "$1" -x "$1.sig" \
|| die "signing $1 with the root key failed"
echo "sign-release: $1.sig (signed by the root key)"
;;
verify)
PUB=${SIGNIFY_PUBKEY:-/etc/signify/makronix-0.99.pub}
[ -r "$PUB" ] || die "cannot read $PUB (signify public key)"
ROOT=${SIGNIFY_ROOT_PUBKEY:-/etc/signify/makronix-root.pub}
[ -r "$PUB" ] || die "cannot read $PUB (signify release key)"
if [ -r "$ROOT" ] && [ -r "$PUB.sig" ]; then
"$SIGNIFY" -V -p "$ROOT" -m "$PUB" -x "$PUB.sig" \
|| die "the release key $PUB is not signed by the root key"
echo "sign-release: $PUB: signed by the root key"
fi
for f in "$@"; do
[ -f "$f" ] || die "no $f"
[ -f "$f.sig" ] || die "no $f.sig"