2014-10-27 08:07:25 +01:00
|
|
|
#!/bin/sh
|
|
|
|
INPUT=$(</dev/stdin)
|
|
|
|
VALID=false
|
2015-10-23 11:05:42 +02:00
|
|
|
REVSIG=false
|
2014-10-27 08:07:25 +01:00
|
|
|
IFS=$'\n'
|
|
|
|
for LINE in $(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null); do
|
2015-10-23 11:05:42 +02:00
|
|
|
case "$LINE" in
|
|
|
|
"[GNUPG:] VALIDSIG "*)
|
2014-10-27 08:07:25 +01:00
|
|
|
while read KEY; do
|
|
|
|
case "$LINE" in "[GNUPG:] VALIDSIG $KEY "*) VALID=true;; esac
|
|
|
|
done < ./contrib/verify-commits/trusted-keys
|
2015-10-23 11:05:42 +02:00
|
|
|
;;
|
|
|
|
"[GNUPG:] REVKEYSIG "*)
|
|
|
|
[ "$BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG" != 1 ] && exit 1
|
|
|
|
while read KEY; do
|
|
|
|
case "$LINE" in "[GNUPG:] REVKEYSIG ${KEY:24:40} "*)
|
|
|
|
REVSIG=true
|
|
|
|
GOODREVSIG="[GNUPG:] GOODSIG ${KEY:24:40} "
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done < ./contrib/verify-commits/trusted-keys
|
|
|
|
;;
|
2014-10-27 08:07:25 +01:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
if ! $VALID; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2015-10-23 11:05:42 +02:00
|
|
|
if $VALID && $REVSIG; then
|
2018-06-18 07:07:41 +02:00
|
|
|
echo "$INPUT" | gpg --trust-model always "$@" | grep "^\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)" 2>/dev/null
|
2015-10-23 11:05:42 +02:00
|
|
|
echo "$GOODREVSIG"
|
|
|
|
else
|
|
|
|
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
|
|
|
|
fi
|