File tree Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- INPUT=$( < /dev/stdin)
2
+ INPUT=$( cat /dev/stdin)
3
3
VALID=false
4
4
REVSIG=false
5
- IFS=$' \n '
5
+ IFS='
6
+ '
6
7
for LINE in $( echo " $INPUT " | gpg --trust-model always " $@ " 2> /dev/null) ; do
7
8
case " $LINE " in
8
9
" [GNUPG:] VALIDSIG " * )
@@ -13,10 +14,9 @@ for LINE in $(echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null); do
13
14
" [GNUPG:] REVKEYSIG " * )
14
15
[ " $BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG " != 1 ] && exit 1
15
16
while read KEY; do
16
- case " $LINE " in " [GNUPG:] REVKEYSIG ${KEY: 24 : 40 } " * )
17
+ case " $LINE " in " [GNUPG:] REVKEYSIG ${KEY# ???????????????????????? } " * )
17
18
REVSIG=true
18
- GOODREVSIG=" [GNUPG:] GOODSIG ${KEY: 24: 40} "
19
- ;;
19
+ GOODREVSIG=" [GNUPG:] GOODSIG ${KEY# ????????????????????????} "
20
20
esac
21
21
done < ./contrib/verify-commits/trusted-keys
22
22
;;
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
+ # Not technically POSIX-compliant due to use of "local", but almost every
3
+ # shell anyone uses today supports it, so its probably fine
2
4
3
5
DIR=$( dirname " $0 " )
4
6
5
7
echo " Please verify all commits in the following list are not evil:"
6
8
git log " $DIR "
7
9
8
10
VERIFIED_ROOT=$( cat " ${DIR} /trusted-git-root" )
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
- }
11
+ REVSIG_ALLOWED=$( cat " ${DIR} /allow-revsig-commits" )
16
12
17
13
HAVE_FAILED=false
18
14
IS_SIGNED () {
19
15
if [ $1 = $VERIFIED_ROOT ]; then
20
16
return 0;
21
17
fi
22
- if IS_REVSIG_ALLOWED " $1 " ; then
18
+ if [ " ${REVSIG_ALLOWED #* $1 } " != " $REVSIG_ALLOWED " ] ; then
23
19
export BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG=1
24
20
else
25
21
export BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG=0
26
22
fi
27
23
if ! git -c " gpg.program=${DIR} /gpg.sh" verify-commit $1 > /dev/null 2>&1 ; then
28
24
return 1;
29
25
fi
30
- local PARENTS=$( git show -s --format=format:%P $1 )
26
+ local PARENTS
27
+ PARENTS=$( git show -s --format=format:%P $1 )
31
28
for PARENT in $PARENTS ; do
32
29
if IS_SIGNED $PARENT > /dev/null; then
33
30
return 0;
You can’t perform that action at this time.
0 commit comments