aboutsummaryrefslogtreecommitdiff
path: root/contrib/verify-commits/gpg.sh
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-03-20 12:04:23 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-03-20 12:05:05 +0100
commitc7abfa595dda5b74b0386532dc6a685ab1c7f009 (patch)
treef5cc097784cc4b011a67844bfaf2817791a57006 /contrib/verify-commits/gpg.sh
parent29fef0b9039be4a9595d4ecc44bc77a06321fc10 (diff)
parentadaa568722e59cde510c5fe1997c49cbb9d7db12 (diff)
downloadbitcoin-c7abfa595dda5b74b0386532dc6a685ab1c7f009.tar.xz
Merge pull request #5149
adaa568 Add script to verify all merge commits are signed (Matt Corallo)
Diffstat (limited to 'contrib/verify-commits/gpg.sh')
-rwxr-xr-xcontrib/verify-commits/gpg.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/verify-commits/gpg.sh b/contrib/verify-commits/gpg.sh
new file mode 100755
index 0000000000..6b5137e7b5
--- /dev/null
+++ b/contrib/verify-commits/gpg.sh
@@ -0,0 +1,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