]>
Commit | Line | Data |
---|---|---|
37d3e859 JK |
1 | #!/bin/sh |
2 | ||
be194d53 | 3 | gpg_version=$(gpg --version 2>&1) |
f9e9c0d1 ES |
4 | if test $? != 127 |
5 | then | |
37d3e859 JK |
6 | # As said here: http://www.gnupg.org/documentation/faqs.html#q6.19 |
7 | # the gpg version 1.0.6 didn't parse trust packets correctly, so for | |
8 | # that version, creation of signed tags using the generated key fails. | |
9 | case "$gpg_version" in | |
10 | 'gpg (GnuPG) 1.0.6'*) | |
11 | say "Your version of gpg (1.0.6) is too buggy for testing" | |
12 | ;; | |
13 | *) | |
6fb5df6c CH |
14 | # Available key info: |
15 | # * Type DSA and Elgamal, size 2048 bits, no expiration date, | |
16 | # name and email: C O Mitter <committer@example.com> | |
17 | # * Type RSA, size 2048 bits, no expiration date, | |
18 | # name and email: Eris Discordia <discord@example.net> | |
37d3e859 | 19 | # No password given, to enable non-interactive operation. |
6fb5df6c CH |
20 | # To generate new key: |
21 | # gpg --homedir /tmp/gpghome --gen-key | |
22 | # To write armored exported key to keyring: | |
23 | # gpg --homedir /tmp/gpghome --export-secret-keys \ | |
24 | # --armor 0xDEADBEEF >> lib-gpg/keyring.gpg | |
830ff021 JK |
25 | # gpg --homedir /tmp/gpghome --export \ |
26 | # --armor 0xDEADBEEF >> lib-gpg/keyring.gpg | |
6fb5df6c CH |
27 | # To export ownertrust: |
28 | # gpg --homedir /tmp/gpghome --export-ownertrust \ | |
29 | # > lib-gpg/ownertrust | |
4b0bf39d JH |
30 | mkdir ./gpghome && |
31 | chmod 0700 ./gpghome && | |
32 | GNUPGHOME="$(pwd)/gpghome" && | |
33 | export GNUPGHOME && | |
4c180f60 | 34 | (gpgconf --kill gpg-agent >/dev/null 2>&1 || : ) && |
4b0bf39d JH |
35 | gpg --homedir "${GNUPGHOME}" 2>/dev/null --import \ |
36 | "$TEST_DIRECTORY"/lib-gpg/keyring.gpg && | |
37 | gpg --homedir "${GNUPGHOME}" 2>/dev/null --import-ownertrust \ | |
38 | "$TEST_DIRECTORY"/lib-gpg/ownertrust && | |
1f985d60 JK |
39 | gpg --homedir "${GNUPGHOME}" </dev/null >/dev/null 2>&1 \ |
40 | --sign -u committer@example.com && | |
37d3e859 JK |
41 | test_set_prereq GPG |
42 | ;; | |
43 | esac | |
44 | fi | |
e2b23972 | 45 | |
4b0bf39d JH |
46 | if test_have_prereq GPG && |
47 | echo | gpg --homedir "${GNUPGHOME}" -b --rfc1991 >/dev/null 2>&1 | |
48 | then | |
49 | test_set_prereq RFC1991 | |
50 | fi | |
51 | ||
e2b23972 MG |
52 | sanitize_pgp() { |
53 | perl -ne ' | |
54 | /^-----END PGP/ and $in_pgp = 0; | |
55 | print unless $in_pgp; | |
56 | /^-----BEGIN PGP/ and $in_pgp = 1; | |
57 | ' | |
58 | } |