Skip to content

Commit eddc77a

Browse files
petertoddTheBlueMatt
authored andcommitted
Add comment re: why SHA1 is disabled
1 parent d9c450f commit eddc77a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

contrib/verify-commits/gpg.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ IFS='
1111
if [ "$BITCOIN_VERIFY_COMMITS_ALLOW_SHA1" = 1 ]; then
1212
GPG_RES="$(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null)"
1313
else
14+
# Note how we've disabled SHA1 with the --weak-digest option, disabling
15+
# signatures - including selfsigs - that use SHA1. While you might think that
16+
# collision attacks shouldn't be an issue as they'd be an attack on yourself,
17+
# in fact because what's being signed is a commit object that's
18+
# semi-deterministically generated by untrusted input (the pull-req) in theory
19+
# an attacker could construct a pull-req that results in a commit object that
20+
# they've created a collision for. Not the most likely attack, but preventing
21+
# it is pretty easy so we do so as a "belt-and-suspenders" measure.
22+
1423
GPG_RES="$(echo "$INPUT" | gpg --trust-model always --weak-digest sha1 "$@" 2>/dev/null)"
1524
fi
1625
for LINE in $(echo "$GPG_RES"); do

0 commit comments

Comments
 (0)