aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Todd <[email protected]>2017-03-01 10:58:14 -0500
committerMatt Corallo <[email protected]>2017-03-04 09:41:16 -0500
commiteddc77a1b1a59df4c7ba1a0705d684529b2205a1 (patch)
tree5daf250a6afba939c4007f87319cd305f72ea0cf
parentVerify Tree-SHA512s in merge commits, enforce sigs are not SHA1 (diff)
downloaddiscoin-eddc77a1b1a59df4c7ba1a0705d684529b2205a1.tar.xz
discoin-eddc77a1b1a59df4c7ba1a0705d684529b2205a1.zip
Add comment re: why SHA1 is disabled
-rwxr-xr-xcontrib/verify-commits/gpg.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/verify-commits/gpg.sh b/contrib/verify-commits/gpg.sh
index 4df8bee3b..61e755286 100755
--- a/contrib/verify-commits/gpg.sh
+++ b/contrib/verify-commits/gpg.sh
@@ -11,6 +11,15 @@ IFS='
if [ "$BITCOIN_VERIFY_COMMITS_ALLOW_SHA1" = 1 ]; then
GPG_RES="$(echo "$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
+ # collision attacks shouldn't be an issue as they'd be an attack on yourself,
+ # in fact because what's being signed is a commit object that's
+ # semi-deterministically generated by untrusted input (the pull-req) in theory
+ # an attacker could construct a pull-req that results in a commit object that
+ # they've created a collision for. Not the most likely attack, but preventing
+ # it is pretty easy so we do so as a "belt-and-suspenders" measure.
+
GPG_RES="$(echo "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null)"
fi
for LINE in $(echo "$GPG_RES"); do