Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions asmap-verify
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ check_tools() {
done
}

check_tools cat diff gpg basename date
GPG=${GPG:-gpg}

check_tools cat diff basename date "$GPG"

################
# Usage
Expand Down Expand Up @@ -112,18 +114,18 @@ verify() {
local signer_name
signer_name="$(basename "$(dirname "$current_manifest")")"

if ! gpg --quiet --batch \
if ! "${GPG}" --quiet --batch \
--verify "${current_manifest}.asc" "$current_manifest" 1>&2; then
echo "ERR: Failed to verify GPG signature for signer '${signer_name}'"
echo " Manifest: '${current_manifest}'"
echo " Signature: '${current_manifest}.asc'"
echo ""
echo "Hint: Either the signature is invalid or the public key is not in"
echo " your GPG keyring. You can import it with:"
echo " gpg --import '${builder_keys_dir}/${signer_name}.gpg'"
echo " ${GPG} --import '${builder_keys_dir}/${signer_name}.gpg'"
echo ""
failure=1
elif ! diff --report-identical "$compare_base" "$current_manifest" 1>&2; then
elif ! diff -s "$compare_base" "$current_manifest" 1>&2; then
echo "ERR: The SHA256SUMS attestation differs from the compare base:"
echo " base: '${compare_base}'"
echo " current: '${current_manifest}'"
Expand Down
Loading