Skip to content

Commit 4a46638

Browse files
committed
guix: Allow changing the base manifest in guix-verify
When verifying guix attestations, it is useful to set a particular signer's manifest as the base to compare against.
1 parent 33455c7 commit 4a46638

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

contrib/guix/guix-verify

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ cmd_usage() {
2828
cat <<EOF
2929
Synopsis:
3030
31-
env GUIX_SIGS_REPO=<path/to/guix.sigs> ./contrib/guix/guix-verify
31+
env GUIX_SIGS_REPO=<path/to/guix.sigs> [ SIGNER=<signer> ] ./contrib/guix/guix-verify
32+
33+
Example overriding signer's manifest to use as base
34+
35+
env GUIX_SIGS_REPO=/home/dongcarl/guix.sigs SIGNER=achow101 ./contrib/guix/guix-verify
3236
3337
EOF
3438
}
@@ -92,6 +96,17 @@ echo "--------------------"
9296
echo ""
9397
if (( ${#all_noncodesigned[@]} )); then
9498
compare_noncodesigned="${all_noncodesigned[0]}"
99+
if [[ -n "$SIGNER" ]]; then
100+
signer_noncodesigned="$OUTSIGDIR_BASE/$SIGNER/noncodesigned.SHA256SUMS"
101+
if [[ -f "$signer_noncodesigned" ]]; then
102+
echo "Using $SIGNER's manifest as the base to compare against"
103+
compare_noncodesigned="$signer_noncodesigned"
104+
else
105+
echo "Unable to find $SIGNER's manifest, using the first one found"
106+
fi
107+
else
108+
echo "No SIGNER provided, using the first manifest found"
109+
fi
95110

96111
for current_manifest in "${all_noncodesigned[@]}"; do
97112
verify "$compare_noncodesigned" "$current_manifest"
@@ -112,6 +127,17 @@ echo "--------------------"
112127
echo ""
113128
if (( ${#all_all[@]} )); then
114129
compare_all="${all_all[0]}"
130+
if [[ -n "$SIGNER" ]]; then
131+
signer_all="$OUTSIGDIR_BASE/$SIGNER/all.SHA256SUMS"
132+
if [[ -f "$signer_all" ]]; then
133+
echo "Using $SIGNER's manifest as the base to compare against"
134+
compare_all="$signer_all"
135+
else
136+
echo "Unable to find $SIGNER's manifest, using the first one found"
137+
fi
138+
else
139+
echo "No SIGNER provided, using the first manifest found"
140+
fi
115141

116142
for current_manifest in "${all_all[@]}"; do
117143
verify "$compare_all" "$current_manifest"

0 commit comments

Comments
 (0)