Skip to content

Commit 3d4eecc

Browse files
committed
Merge branch 'ch/new-gpg-drops-rfc-1991'
Recent GPG changes the keyring format and drops support for RFC1991 formatted signatures, breaking our existing tests. * ch/new-gpg-drops-rfc-1991: tests: make comment on GPG keyring match the code tests: squelch noise from GPG machinery set-up tests: replace binary GPG keyrings with ASCII-armored keys tests: skip RFC1991 tests for gnupg 2.1 tests: create gpg homedir on the fly
2 parents 2df3973 + 6fb5df6 commit 3d4eecc

File tree

8 files changed

+126
-15
lines changed

8 files changed

+126
-15
lines changed

t/lib-gpg.sh

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,39 @@ else
1212
say "Your version of gpg (1.0.6) is too buggy for testing"
1313
;;
1414
*)
15-
# key generation info: gpg --homedir t/lib-gpg --gen-key
16-
# Type DSA and Elgamal, size 2048 bits, no expiration date.
17-
# Name and email: C O Mitter <[email protected]>
15+
# Available key info:
16+
# * Type DSA and Elgamal, size 2048 bits, no expiration date,
17+
# name and email: C O Mitter <[email protected]>
18+
# * Type RSA, size 2048 bits, no expiration date,
19+
# name and email: Eris Discordia <[email protected]>
1820
# No password given, to enable non-interactive operation.
19-
cp -R "$TEST_DIRECTORY"/lib-gpg ./gpghome
20-
chmod 0700 gpghome
21-
chmod 0600 gpghome/*
22-
GNUPGHOME="$(pwd)/gpghome"
23-
export GNUPGHOME
21+
# To generate new key:
22+
# gpg --homedir /tmp/gpghome --gen-key
23+
# To write armored exported key to keyring:
24+
# gpg --homedir /tmp/gpghome --export-secret-keys \
25+
# --armor 0xDEADBEEF >> lib-gpg/keyring.gpg
26+
# To export ownertrust:
27+
# gpg --homedir /tmp/gpghome --export-ownertrust \
28+
# > lib-gpg/ownertrust
29+
mkdir ./gpghome &&
30+
chmod 0700 ./gpghome &&
31+
GNUPGHOME="$(pwd)/gpghome" &&
32+
export GNUPGHOME &&
33+
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \
34+
"$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
35+
gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \
36+
"$TEST_DIRECTORY"/lib-gpg/ownertrust &&
2437
test_set_prereq GPG
2538
;;
2639
esac
2740
fi
2841

42+
if test_have_prereq GPG &&
43+
echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >/dev/null 2>&1
44+
then
45+
test_set_prereq RFC1991
46+
fi
47+
2948
sanitize_pgp() {
3049
perl -ne '
3150
/^-----END PGP/ and $in_pgp = 0;

t/lib-gpg/keyring.gpg

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
-----BEGIN PGP PRIVATE KEY BLOCK-----
2+
Version: GnuPG v1
3+
4+
lQG7BEZnyykRBACzCPjIpTYNL7Y2tQqlEGTTDlvZcWNLjF5f7ZzuyOqNOidLUgFD
5+
36qch1LZLSZkShdR3Gae+bsolyjxrlFuFP0eXRPMtqK20aLw7WZvPFpEV1ThMne+
6+
PRJjYrvghWw3L0VVIAIZ8GXwrVBuU99uEjHEI0ojYloOvFc2jVPgSaoBvwCg48Tj
7+
fol2foSoJa7XUu9yAL8szg8D/RUsTzNF+I9hSRHl7MYKFMYoKEY9BDgrgAujp7YY
8+
8qdGsiUb0Ggyzp2kRjZFt4lpcvKhGfHn5GEjmtk+fRbD5qPfMqKFW+T0NPfYlYmL
9+
JJ4fs4qZ8Lx7x6iG6X51u+YNwsQuIGjMCC3CeNi3F7or651kkNYASbaQ1NROkCIN
10+
NudyA/0aasvoZUoNJAc2cP5Ifs6WhXMWLfMR2p2XbfKwKNYneec60usnSComcKqh
11+
sJVk0Gytvr3FOYVhRkXnKAbx+0W2urFP8OFVBTEKO6Ts2VygWGgneQYoHnqzwlUE
12+
yjOjlr+lyf7u2s/KAxpKA6jnttEdRZAmzWkhuox1wwAUkr27/QAAn3TEzKR1pxxR
13+
+R3dHuFpnnfatMIDC5O0IkMgTyBNaXR0ZXIgPGNvbW1pdHRlckBleGFtcGxlLmNv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
81+
BQJRTJZHAhsMAAoJEGEJLoW3InGJ7HEIAMXkMf4cOWmnAuvvcSm3KpLghuWik9dy
82+
fn1sY/IG5atoKK+ypmV/TlBlMZqFQzuPIJQT8VLbmxtLlDhJG04LbI6c8axIZxOO
83+
ZKLy5nTTSy16ztqEeS7eifHLPZg1UFFyEEIQ1XW0CNDAeuWKh90ERjyl4Cg7PnWS
84+
Z9Ei+zj6JD5Pcdi3BJhQo9WOLOVEJ0NHmewTYqk9QVXH/0v1Hdl4LMJtgcbdbDWk
85+
4UTkXbg9pn3umCgkNJ3Vs8fWnIWO9Izdr2/wrFY2JvUT7Yvl+wsNIWatvOEzGy7n
86+
BOW78WUxzhu0YJTLKy+iKCjg5HS5dx6OC+e4aEEgfhNPCMkbvDsJjtQ=
87+
=hieJ
88+
-----END PGP PRIVATE KEY BLOCK-----

t/lib-gpg/ownertrust

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# List of assigned trustvalues, created Thu 11 Dec 2014 01:26:28 PM CET
2+
# (Use "gpg --import-ownertrust" to restore them)
3+
73D758744BE721698EC54E8713B6F51ECDDE430D:6:
4+
D4BE22311AD3131E5EDA29A461092E85B7227189:3:

t/lib-gpg/pubring.gpg

-2.3 KB
Binary file not shown.

t/lib-gpg/random_seed

-600 Bytes
Binary file not shown.

t/lib-gpg/secring.gpg

-3.65 KB
Binary file not shown.

t/lib-gpg/trustdb.gpg

-1.33 KB
Binary file not shown.

t/t7004-tag.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ test_expect_success GPG \
10811081
get_tag_header rfc1991-signed-tag $commit commit $time >expect
10821082
echo "RFC1991 signed tag" >>expect
10831083
echo '-----BEGIN PGP MESSAGE-----' >>expect
1084-
test_expect_success GPG \
1084+
test_expect_success GPG,RFC1991 \
10851085
'creating a signed tag with rfc1991' '
10861086
echo "rfc1991" >gpghome/gpg.conf &&
10871087
git tag -s -m "RFC1991 signed tag" rfc1991-signed-tag $commit &&
@@ -1095,21 +1095,21 @@ cp "$1" actual
10951095
EOF
10961096
chmod +x fakeeditor
10971097

1098-
test_expect_success GPG \
1098+
test_expect_success GPG,RFC1991 \
10991099
'reediting a signed tag body omits signature' '
11001100
echo "rfc1991" >gpghome/gpg.conf &&
11011101
echo "RFC1991 signed tag" >expect &&
11021102
GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&
11031103
test_cmp expect actual
11041104
'
11051105

1106-
test_expect_success GPG \
1106+
test_expect_success GPG,RFC1991 \
11071107
'verifying rfc1991 signature' '
11081108
echo "rfc1991" >gpghome/gpg.conf &&
11091109
git tag -v rfc1991-signed-tag
11101110
'
11111111

1112-
test_expect_success GPG \
1112+
test_expect_success GPG,RFC1991 \
11131113
'list tag with rfc1991 signature' '
11141114
echo "rfc1991" >gpghome/gpg.conf &&
11151115
echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
@@ -1123,12 +1123,12 @@ test_expect_success GPG \
11231123

11241124
rm -f gpghome/gpg.conf
11251125

1126-
test_expect_success GPG \
1126+
test_expect_success GPG,RFC1991 \
11271127
'verifying rfc1991 signature without --rfc1991' '
11281128
git tag -v rfc1991-signed-tag
11291129
'
11301130

1131-
test_expect_success GPG \
1131+
test_expect_success GPG,RFC1991 \
11321132
'list tag with rfc1991 signature without --rfc1991' '
11331133
echo "rfc1991-signed-tag RFC1991 signed tag" >expect &&
11341134
git tag -l -n1 rfc1991-signed-tag >actual &&
@@ -1139,7 +1139,7 @@ test_expect_success GPG \
11391139
test_cmp expect actual
11401140
'
11411141

1142-
test_expect_success GPG \
1142+
test_expect_success GPG,RFC1991 \
11431143
'reediting a signed tag body omits signature' '
11441144
echo "RFC1991 signed tag" >expect &&
11451145
GIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&

0 commit comments

Comments
 (0)