2014-10-27 08:07:25 +01:00
|
|
|
#!/bin/sh
|
2016-05-21 03:29:15 +02:00
|
|
|
INPUT=$(cat /dev/stdin)
|
2014-10-27 08:07:25 +01:00
|
|
|
VALID=false
|
2015-10-23 11:05:42 +02:00
|
|
|
REVSIG=false
|
2016-05-21 03:29:15 +02:00
|
|
|
IFS='
|
|
|
|
'
|
2014-10-27 08:07:25 +01:00
|
|
|
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
|
2016-05-21 03:29:15 +02:00
|
|
|
case "$LINE" in "[GNUPG:] REVKEYSIG ${KEY#????????????????????????} "*)
|
2015-10-23 11:05:42 +02:00
|
|
|
REVSIG=true
|
2016-05-21 03:29:15 +02:00
|
|
|
GOODREVSIG="[GNUPG:] GOODSIG ${KEY#????????????????????????} "
|
2015-10-23 11:05:42 +02:00
|
|
|
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
|
|
|
|
echo "$INPUT" | gpg --trust-model always "$@" | grep "\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)" 2>/dev/null
|
|
|
|
echo "$GOODREVSIG"
|
|
|
|
else
|
|
|
|
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
|
|
|
|
fi
|