You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gpg.sh 909B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. INPUT=$(cat /dev/stdin)
  3. VALID=false
  4. REVSIG=false
  5. IFS='
  6. '
  7. for LINE in $(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null); do
  8. case "$LINE" in
  9. "[GNUPG:] VALIDSIG "*)
  10. while read KEY; do
  11. case "$LINE" in "[GNUPG:] VALIDSIG $KEY "*) VALID=true;; esac
  12. done < ./contrib/verify-commits/trusted-keys
  13. ;;
  14. "[GNUPG:] REVKEYSIG "*)
  15. [ "$BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG" != 1 ] && exit 1
  16. while read KEY; do
  17. case "$LINE" in "[GNUPG:] REVKEYSIG ${KEY#????????????????????????} "*)
  18. REVSIG=true
  19. GOODREVSIG="[GNUPG:] GOODSIG ${KEY#????????????????????????} "
  20. esac
  21. done < ./contrib/verify-commits/trusted-keys
  22. ;;
  23. esac
  24. done
  25. if ! $VALID; then
  26. exit 1
  27. fi
  28. if $VALID && $REVSIG; then
  29. echo "$INPUT" | gpg --trust-model always "$@" | grep "\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)" 2>/dev/null
  30. echo "$GOODREVSIG"
  31. else
  32. echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
  33. fi