Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The previous test GPG keys had expired on 2015-08-22, causing all subsequent Travis CI builds to fail. The new keys are set to not expire, to avoid a repeat of this problem in future. test/gnupg_test_home/regen_keys.sh modified for GPG 2.1+, storing keys in formats suitable for use by GPG 1, GPG 2.0, and GPG 2.1+. Note: - RSA instead of DSA, because GPG 2.1+ doesn't like DSA for usage "encrypt" - ECC test key wasn't being used by any tests, so not regenerated
- Loading branch information
Showing
15 changed files
with
90 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+1.39 KB
test/gnupg_test_home/private-keys-v1.d/306D2EE90FF0014B5B9FD07E265C751791674140.key
Binary file not shown.
1 change: 0 additions & 1 deletion
1
test/gnupg_test_home/private-keys-v1.d/719C7455A7169C6EE8819C6E91002E4F9DD00A65.key
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-493 Bytes
test/gnupg_test_home/private-keys-v1.d/8A130806A754AA29D59487D76BD355040D9F26C0.key
Binary file not shown.
Binary file removed
BIN
-346 Bytes
test/gnupg_test_home/private-keys-v1.d/B7AA46B22BD8A6AD1B4F266C19A3B124A32DDD71.key
Binary file not shown.
Binary file removed
BIN
-1.13 KB
test/gnupg_test_home/private-keys-v1.d/FA64ACD7CC871371BDF57285A6CDF0E618827783.key
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,89 @@ | ||
#! /bin/bash | ||
#!/bin/bash | ||
# | ||
# re-generate test keys for the sup test base | ||
# | ||
# https://github.com/sup-heliotrope/sup/wiki/Development%3A-Crypto | ||
# | ||
# Requires GPG 2.1+ installed as "gpg2" | ||
# | ||
# GPG 2.1+ by default uses pubring.kbx - but this isn't backwards compatible | ||
# with GPG 1 or GPG 2.0. | ||
# Workaround: | ||
# - Create empty pubring.gpg file, which causes GPG 2.1+ to use this | ||
# backwards-compatible store. | ||
# - Manually export private key copy to secring.gpg, which would be used | ||
# by GPG 1. | ||
|
||
set -e -u -o pipefail | ||
|
||
pushd $(dirname $0) | ||
|
||
export GNUPGHOME="$(pwd)" | ||
echo "Generating keys in: $(pwd)..." | ||
|
||
echo "genrating keys in: $GNUPGHOME.." | ||
echo "Checking gpg2 version" | ||
gpg2 --version | head -1 | ||
|
||
rm *.gpg *.asc | ||
echo "Deleting all existing test keys" | ||
rm -f \ | ||
*.gpg \ | ||
*.asc \ | ||
private-keys-v1.d/*.key \ | ||
.gpg-v21-migrated | ||
|
||
echo "generate receiver key.." | ||
gpg --batch --gen-key key2.gen | ||
echo "Generating key pair for test receiver (email sup-test-2@foo.bar.asc)" | ||
touch pubring.gpg # So GPG 2.1+ writes to pubring.gpg instead of pubring.kbx | ||
gpg2 \ | ||
--homedir . \ | ||
--batch \ | ||
--pinentry-mode loopback \ | ||
--passphrase '' \ | ||
--quick-generate-key sup-test-2@foo.bar rsa encrypt,sign 0 | ||
|
||
echo "export receiver key.." | ||
echo "Exporting public key only for test receiver (file sup-test-2@foo.bar.asc)" | ||
gpg2 \ | ||
--homedir . \ | ||
--armor \ | ||
--output sup-test-2@foo.bar.asc \ | ||
--export sup-test-2@foo.bar | ||
|
||
gpg --output sup-test-2@foo.bar.asc --armor --export sup-test-2@foo.bar | ||
echo "Backing up secret key for test receiver (file receiver_secring.gpg)" | ||
gpg2 \ | ||
--homedir . \ | ||
--export-secret-keys \ | ||
>receiver_secring.gpg | ||
|
||
mv trustdb.gpg receiver_trustdb.gpg | ||
mv secring.gpg receiver_secring.gpg | ||
mv pubring.gpg receiver_pubring.gpg | ||
echo "Backing up pubring.gpg for test receiver (file receiver_pubring.gpg)" | ||
cp -a pubring.gpg receiver_pubring.gpg | ||
|
||
echo "generate sender key.." | ||
gpg --batch --gen-key key1.gen | ||
echo "Clearing key store, so we can start from a blank slate for next key(s)" | ||
rm -f pubring.gpg trustdb.gpg private-keys-v1.d/*.key .gpg-v21-migrated | ||
|
||
echo "generate ecc key.." | ||
gpg --batch --gen-key key_ecc.gen | ||
echo "Generating key pair for sender (email sup-test-1@foo.bar)" | ||
touch pubring.gpg # So GPG 2.1+ writes to pubring.gpg instead of pubring.kbx | ||
gpg2 \ | ||
--homedir . \ | ||
--batch \ | ||
--pinentry-mode loopback \ | ||
--passphrase '' \ | ||
--quick-generate-key sup-test-1@foo.bar rsa encrypt,sign 0 | ||
|
||
echo "import receiver key.." | ||
gpg --import sup-test-2@foo.bar.asc | ||
echo "Importing public key for receiver, into sender's key store" | ||
gpg2 \ | ||
--homedir . \ | ||
--import sup-test-2@foo.bar.asc | ||
|
||
echo "Copy private key also to secring.gpg (old format used by GPG 1)" | ||
gpg2 \ | ||
--homedir . \ | ||
--export-secret-keys \ | ||
>secring.gpg | ||
|
||
echo "Done." | ||
|
||
popd | ||
echo "We now have two non-expiring public keys (receiver & sender):" | ||
gpg2 --homedir . --list-keys | ||
|
||
echo "And we also have only *one* corresponding private key (sender only):" | ||
gpg2 --homedir . --list-secret-keys | ||
|
||
popd |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
Version: GnuPG v2 | ||
|
||
mQGiBFP3VogRBADVBEkaZQXj728C1HUIaTRDCFoKzojwC79Z1BLsD72qQYE8z1ic | ||
5P9CJpJU5wbhQFDTGBjw+i1nNTWy01z4q5bfFqok+KorT3XNp5IJRcRIEOkj+Twq | ||
7ZaSODw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