aboutsummaryrefslogtreecommitdiff
path: root/contrib/verify-commits/gpg.sh
blob: 6b5137e7b54e545f4ea2211009b1b3e65bebf304 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
INPUT=$(</dev/stdin)
VALID=false
IFS=$'\n'
for LINE in $(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null); do
	case "$LINE" in "[GNUPG:] VALIDSIG"*)
		while read KEY; do
			case "$LINE" in "[GNUPG:] VALIDSIG $KEY "*) VALID=true;; esac
		done < ./contrib/verify-commits/trusted-keys
	esac
done
if ! $VALID; then
	exit 1
fi
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null