Skip to content

Commit

Permalink
Merge bitcoin#11834: [verify-commits] Fix gpg.sh's echoing for commit…
Browse files Browse the repository at this point in the history
…s with '\n'

a38686c [verify-commits] Fix gpg.sh's echoing for commits with '\n' (Matt Corallo)

Pull request description:

  Should fix master travis failures

Tree-SHA512: 1e96476e4db0474f1dc2c6973cdb1154316b7cec13d3fe46f3383cfe4f1ed30c2eee08a0d047931f20b2fa83baaacb4687f39e1cab6f264009cd0292134facdd
  • Loading branch information
sipa authored and PastaPastaPasta committed Jan 30, 2020
1 parent 608fad5 commit f32949f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contrib/verify-commits/gpg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ REVSIG=false
IFS='
'
if [ "$BITCOIN_VERIFY_COMMITS_ALLOW_SHA1" = 1 ]; then
GPG_RES="$(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)"
GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)"
else
# Note how we've disabled SHA1 with the --weak-digest option, disabling
# signatures - including selfsigs - that use SHA1. While you might think that
Expand All @@ -24,15 +24,15 @@ else
case "$LINE" in
"gpg (GnuPG) 1.4.1"*|"gpg (GnuPG) 2.0."*)
echo "Please upgrade to at least gpg 2.1.10 to check for weak signatures" > /dev/stderr
GPG_RES="$(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)"
GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)"
;;
# We assume if you're running 2.1+, you're probably running 2.1.10+
# gpg will fail otherwise
# We assume if you're running 1.X, it is either 1.4.1X or 1.4.20+
# gpg will fail otherwise
esac
done
[ "$GPG_RES" = "" ] && GPG_RES="$(echo "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null)"
[ "$GPG_RES" = "" ] && GPG_RES="$(printf '%s\n' "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null)"
fi
for LINE in $(echo "$GPG_RES"); do
case "$LINE" in
Expand All @@ -57,8 +57,8 @@ if ! $VALID; then
exit 1
fi
if $VALID && $REVSIG; then
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | grep "\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)"
printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null | grep "\[GNUPG:\] \(NEWSIG\|SIG_ID\|VALIDSIG\)"
echo "$GOODREVSIG"
else
echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
printf '%s\n' "$INPUT" | gpg --trust-model always "$@" 2>/dev/null
fi

0 comments on commit f32949f

Please sign in to comment.