Verify Blacksand
These values anchor a clone of bmjcoding/blacksand. This page is published from its own account, outside GitHub.
Genesis root
0671895645102e3ae5ff9d64437fbe0f8ea1a6e7
Checkpoint
67ae833bc9f6c17fffc5803d65c7d5b48470cb72
Genesis signers
genesis.allowed_signers, byte for byte the first commit's .allowed_signers:
| Key | Role | Fingerprint |
|---|---|---|
blacksand-maintainer | signs commits, pins and tags; a hardware security key | SHA256:7t/1K9nAROCbGI2tVCBzcFC/QMqzH3UgoQ/OnJqt7Os |
blacksand-recovery | replaces a lost or compromised maintainer key only; a spare hardware key kept in a safe | SHA256:Y1TQ10nbLsZIvwvsnWsSbUnxcYsi3oumfQ4U76F+86w |
Clone and check
As in tooling/blacksand-t3/docs/install/clone.md. First set the two values above and download the signers file:
export BLACKSAND_ROOT=<genesis root SHA from verify.blacksand.run>
export BLACKSAND_CHECKPOINT=<checkpoint SHA from verify.blacksand.run>
BLACKSAND_SIGNERS_DIR=$(mktemp -d) && chmod 700 "$BLACKSAND_SIGNERS_DIR"
unset BLACKSAND_SIGNERS
if code=$(curl -q -sS --proto '=https' --max-redirs 0 -o "$BLACKSAND_SIGNERS_DIR/genesis.allowed_signers" -w '%{http_code}' https://verify.blacksand.run/genesis.allowed_signers) && [ "$code" = 200 ]; then
export BLACKSAND_SIGNERS="$BLACKSAND_SIGNERS_DIR/genesis.allowed_signers"
else
echo "the signers file wasn't answered directly (HTTP ${code:-none}): stop here" >&2
fi
Then, from the folder the clone goes in:
(
set -eu
: "${BLACKSAND_ROOT:?}" "${BLACKSAND_CHECKPOINT:?}" "${BLACKSAND_SIGNERS:?}"
url=${BLACKSAND_REPO_URL:-https://github.com/bmjcoding/blacksand.git}
dir=${BLACKSAND_DIR:-blacksand}
# One git and one ssh-keygen, named by absolute path, given only the variables
# below: none of this shell's environment (no GIT_* override of any kind), none
# of this machine's git configuration, and no hooks, templates or fsmonitor.
git_bin=${BLACKSAND_GIT:-$(command -v git)}
keygen=${BLACKSAND_SSH_KEYGEN:-$(command -v ssh-keygen)}
case "$git_bin$keygen" in /*/*) ;; *) echo "git and ssh-keygen must be absolute paths" >&2; exit 1 ;; esac
g() { /usr/bin/env -i PATH=/usr/bin:/bin HOME="$HOME" LANG=C GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1 \
GIT_NO_REPLACE_OBJECTS=1 GIT_TERMINAL_PROMPT=0 "$git_bin" -c core.hooksPath=/dev/null -c core.fsmonitor=false "$@"; }
work=$(mktemp -d) && chmod 700 "$work"
test ! -e "$dir"
g clone --quiet --no-checkout --template= "$url" "$dir"
cd "$dir"
test "$(g rev-parse --is-shallow-repository)" = false
# The fetched tip and the checkpoint each have exactly one first commit, the
# published root, and the checkpoint is on the tip's history.
tip=$(g rev-parse --verify "HEAD^{commit}")
test "$(g rev-list --max-parents=0 "$tip")" = "$BLACKSAND_ROOT"
test "$(g rev-list --max-parents=0 "$BLACKSAND_CHECKPOINT")" = "$BLACKSAND_ROOT"
g merge-base --is-ancestor "$BLACKSAND_CHECKPOINT" "$tip"
# The root lists exactly the published keys, as a regular file, and one of them signed it.
test "$(g ls-tree "$BLACKSAND_ROOT" -- .allowed_signers | cut -c1-11)" = "100644 blob"
g cat-file blob "$BLACKSAND_ROOT:.allowed_signers" > "$work/root.allowed_signers"
test -s "$BLACKSAND_SIGNERS"
cmp -s "$work/root.allowed_signers" "$BLACKSAND_SIGNERS"
g -c gpg.format=ssh -c gpg.ssh.program="$keygen" -c gpg.ssh.allowedSignersFile="$BLACKSAND_SIGNERS" \
verify-commit "$BLACKSAND_ROOT"
# Only now are files written: the checkpoint's.
g checkout --quiet -B main "$BLACKSAND_CHECKPOINT"
test "$(g rev-parse HEAD)" = "$BLACKSAND_CHECKPOINT"
status=$(g status --porcelain --untracked-files=all)
test -z "$status"
rm -rf "$work"
echo "anchored at $BLACKSAND_CHECKPOINT in $(pwd)"
)
Incident notices
None.