feat(security): pin two bootstrap signing keys (automated signer + offline backup) (F5)
The single pinned key CbyBk7... has no secret half on record, so it could never
sign anything. Bootstraps are now built, verified and signed weekly by a
dedicated signer box, and an offline backup key covers loss or revocation of
that key. A signature is accepted if it verifies against either pinned key.
- bootstrap.h: kBootstrapSignaturePublicKeysBase64[] = { hot GHgDNfZV..., cold MZi/rTuQ... }
- bootstrap.cpp: Bootstrap::signatureMatchesPinnedKey() checks every pinned key
(no network, unit-testable); a present signature matching none stays fatal.
- tests: the known answer is now a real signer-box signature over a real weekly
checksum (height 3449343); covers tamper, garbage, empty and wrong-key cases,
the two keys being distinct and valid, and CbyBk7 no longer being pinned.
- sign-bootstrap-release.sh: the key check accepts any pinned key.
kBootstrapRequireSignature stays false until every served bootstrap carries a
signature.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# The bootstrap archive (DRAGONX.zip) can be multiple GB, so the wallet does NOT sign the archive bytes.
|
||||
# Instead it verifies a detached ed25519 signature over the published "DRAGONX.zip.sha256" FILE, against a
|
||||
# public key pinned in src/util/bootstrap.h (kBootstrapSignaturePublicKeyBase64). The SHA-256 file already
|
||||
# public keys pinned in src/util/bootstrap.h (kBootstrapSignaturePublicKeysBase64). The SHA-256 file already
|
||||
# binds the archive bytes (the wallet computes and matches the archive's hash first), so signing the small
|
||||
# checksum authenticates the whole download cheaply.
|
||||
#
|
||||
@@ -58,7 +58,7 @@ case "$cmd" in
|
||||
echo "secret key : $prefix.ed25519.key (KEEP OFFLINE, mode 600)"
|
||||
echo "public key : $prefix.ed25519.pub.b64"
|
||||
echo
|
||||
echo "Pin this in src/util/bootstrap.h (kBootstrapSignaturePublicKeyBase64):"
|
||||
echo "Pin this in src/util/bootstrap.h (kBootstrapSignaturePublicKeysBase64):"
|
||||
echo " $pub"
|
||||
;;
|
||||
|
||||
@@ -84,15 +84,15 @@ case "$cmd" in
|
||||
[ -f "$key" ] || die "no such key: $key"
|
||||
[ -f "$zip" ] || die "no such archive: $zip"
|
||||
|
||||
# Warn if this key does not match the public key pinned in the wallet (it would then reject every
|
||||
# signature made with it — expected only when deliberately rotating the pinned key).
|
||||
pinned="$(grep -oE '"[A-Za-z0-9+/]{43}="' "$PROJECT_ROOT/src/util/bootstrap.h" 2>/dev/null | head -1 | tr -d '"')"
|
||||
# Warn if this key is not one of the public keys pinned in the wallet (it would then reject every
|
||||
# signature made with it — expected only when deliberately rotating the pinned keys).
|
||||
pinned="$(grep -oE '"[A-Za-z0-9+/]{43}="' "$PROJECT_ROOT/src/util/bootstrap.h" 2>/dev/null | tr -d '"')"
|
||||
mine="$(pubkey_b64 "$key")"
|
||||
if [ -n "$pinned" ] && [ "$pinned" != "$mine" ]; then
|
||||
echo "WARNING: this key's public key does not match the one pinned in bootstrap.h:" >&2
|
||||
if [ -n "$pinned" ] && ! printf '%s\n' "$pinned" | grep -qxF "$mine"; then
|
||||
echo "WARNING: this key's public key is not pinned in bootstrap.h:" >&2
|
||||
echo " signing key -> $mine" >&2
|
||||
echo " pinned key -> $pinned" >&2
|
||||
echo " The wallet will REJECT these signatures unless you are rotating the pinned key." >&2
|
||||
echo " pinned keys -> $(echo $pinned)" >&2
|
||||
echo " The wallet will REJECT these signatures unless you are rotating the pinned keys." >&2
|
||||
echo >&2
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user