File tree Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Original file line number Diff line number Diff line change
1
+ 586a29253dabec3ca0f1ccba9091daabd16b8411
2
+ eddaba7b5692288087a926da5733e86b47274e4e
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
INPUT=$( < /dev/stdin)
3
3
VALID=false
4
+ REVSIG=false
4
5
IFS=$' \n '
5
6
for LINE in $( echo " $INPUT " | gpg --trust-model always " $@ " 2> /dev/null) ; do
6
- case " $LINE " in " [GNUPG:] VALIDSIG" * )
7
+ case " $LINE " in
8
+ " [GNUPG:] VALIDSIG " * )
7
9
while read KEY; do
8
10
case " $LINE " in " [GNUPG:] VALIDSIG $KEY " * ) VALID=true;; esac
9
11
done < ./contrib/verify-commits/trusted-keys
12
+ ;;
13
+ " [GNUPG:] REVKEYSIG " * )
14
+ [ " $BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG " != 1 ] && exit 1
15
+ while read KEY; do
16
+ case " $LINE " in " [GNUPG:] REVKEYSIG ${KEY: 24: 40} " * )
17
+ REVSIG=true
18
+ GOODREVSIG=" [GNUPG:] GOODSIG ${KEY: 24: 40} "
19
+ ;;
20
+ esac
21
+ done < ./contrib/verify-commits/trusted-keys
22
+ ;;
10
23
esac
11
24
done
12
25
if ! $VALID ; then
13
26
exit 1
14
27
fi
15
- echo " $INPUT " | gpg --trust-model always " $@ " 2> /dev/null
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
Original file line number Diff line number Diff line change @@ -7,11 +7,23 @@ git log "$DIR"
7
7
8
8
VERIFIED_ROOT=$( cat " ${DIR} /trusted-git-root" )
9
9
10
+ IS_REVSIG_ALLOWED () {
11
+ while read LINE; do
12
+ [ " $LINE " = " $1 " ] && return 0
13
+ done < " ${DIR} /allow-revsig-commits"
14
+ return 1
15
+ }
16
+
10
17
HAVE_FAILED=false
11
18
IS_SIGNED () {
12
19
if [ $1 = $VERIFIED_ROOT ]; then
13
20
return 0;
14
21
fi
22
+ if IS_REVSIG_ALLOWED " $1 " ; then
23
+ export BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG=1
24
+ else
25
+ export BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG=0
26
+ fi
15
27
if ! git -c " gpg.program=${DIR} /gpg.sh" verify-commit $1 > /dev/null 2>&1 ; then
16
28
return 1;
17
29
fi
You can’t perform that action at this time.
0 commit comments