summaryrefslogtreecommitdiff
path: root/t/lib-gpg.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-12-22 12:28:16 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-12-22 12:28:17 -0800
commit3d4eecc87192c78065fb7c2f4ff8c98a33e823ea (patch)
treef67ca02a3f4bbc891faf44119722bcb50505805e /t/lib-gpg.sh
parentMerge branch 'jk/commit-date-approxidate' (diff)
parenttests: make comment on GPG keyring match the code (diff)
downloadtgif-3d4eecc87192c78065fb7c2f4ff8c98a33e823ea.tar.xz
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
Diffstat (limited to 't/lib-gpg.sh')
-rwxr-xr-xt/lib-gpg.sh35
1 files changed, 27 insertions, 8 deletions
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
index cd2baef383..d88da29f77 100755
--- a/t/lib-gpg.sh
+++ b/t/lib-gpg.sh
@@ -12,20 +12,39 @@ else
say "Your version of gpg (1.0.6) is too buggy for testing"
;;
*)
- # key generation info: gpg --homedir t/lib-gpg --gen-key
- # Type DSA and Elgamal, size 2048 bits, no expiration date.
- # Name and email: C O Mitter <committer@example.com>
+ # Available key info:
+ # * Type DSA and Elgamal, size 2048 bits, no expiration date,
+ # name and email: C O Mitter <committer@example.com>
+ # * Type RSA, size 2048 bits, no expiration date,
+ # name and email: Eris Discordia <discord@example.net>
# No password given, to enable non-interactive operation.
- cp -R "$TEST_DIRECTORY"/lib-gpg ./gpghome
- chmod 0700 gpghome
- chmod 0600 gpghome/*
- GNUPGHOME="$(pwd)/gpghome"
- export GNUPGHOME
+ # To generate new key:
+ # gpg --homedir /tmp/gpghome --gen-key
+ # To write armored exported key to keyring:
+ # gpg --homedir /tmp/gpghome --export-secret-keys \
+ # --armor 0xDEADBEEF >> lib-gpg/keyring.gpg
+ # To export ownertrust:
+ # gpg --homedir /tmp/gpghome --export-ownertrust \
+ # > lib-gpg/ownertrust
+ mkdir ./gpghome &&
+ chmod 0700 ./gpghome &&
+ GNUPGHOME="$(pwd)/gpghome" &&
+ export GNUPGHOME &&
+ gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \
+ "$TEST_DIRECTORY"/lib-gpg/keyring.gpg &&
+ gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \
+ "$TEST_DIRECTORY"/lib-gpg/ownertrust &&
test_set_prereq GPG
;;
esac
fi
+if test_have_prereq GPG &&
+ echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >/dev/null 2>&1
+then
+ test_set_prereq RFC1991
+fi
+
sanitize_pgp() {
perl -ne '
/^-----END PGP/ and $in_pgp = 0;