core/git/0001-create-gpg-homedir-on-the-fly.patch
2014-12-24 12:43:34 +01:00

59 lines
2.0 KiB
Diff

From d2c93870da4997abeb2813873878c1a556defde4 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Fri, 12 Dec 2014 07:34:34 +0100
Subject: [PATCH 1/3] create gpg homedir on the fly
GnuPG 2.1 homedir looks different, so just create it on the fly by
importing needed private and public keys and ownertrust.
This solves an issue with gnupg 2.1 running interactive pinentry when
old secret key is present.
Signed-off-by: Christian Hesse <mail@eworm.de>
---
t/lib-gpg.sh | 10 +++++++---
t/lib-gpg/ownertrust | 4 ++++
t/lib-gpg/random_seed | Bin 600 -> 0 bytes
t/lib-gpg/trustdb.gpg | Bin 1360 -> 0 bytes
4 files changed, 11 insertions(+), 3 deletions(-)
create mode 100644 t/lib-gpg/ownertrust
delete mode 100644 t/lib-gpg/random_seed
delete mode 100644 t/lib-gpg/trustdb.gpg
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
index cd2baef..4e57942 100755
--- a/t/lib-gpg.sh
+++ b/t/lib-gpg.sh
@@ -16,11 +16,15 @@ else
# Type DSA and Elgamal, size 2048 bits, no expiration date.
# Name and email: C O Mitter <committer@example.com>
# No password given, to enable non-interactive operation.
- cp -R "$TEST_DIRECTORY"/lib-gpg ./gpghome
- chmod 0700 gpghome
- chmod 0600 gpghome/*
+ mkdir ./gpghome
+ chmod 0700 ./gpghome
GNUPGHOME="$(pwd)/gpghome"
export GNUPGHOME
+ gpg --homedir "${GNUPGHOME}" --import \
+ "$TEST_DIRECTORY"/lib-gpg/pubring.gpg \
+ "$TEST_DIRECTORY"/lib-gpg/secring.gpg
+ gpg --homedir "${GNUPGHOME}" --import-ownertrust \
+ "$TEST_DIRECTORY"/lib-gpg/ownertrust
test_set_prereq GPG
;;
esac
diff --git a/t/lib-gpg/ownertrust b/t/lib-gpg/ownertrust
new file mode 100644
index 0000000..b3e3c4f
--- /dev/null
+++ b/t/lib-gpg/ownertrust
@@ -0,0 +1,4 @@
+# List of assigned trustvalues, created Thu 11 Dec 2014 01:26:28 PM CET
+# (Use "gpg --import-ownertrust" to restore them)
+73D758744BE721698EC54E8713B6F51ECDDE430D:6:
+D4BE22311AD3131E5EDA29A461092E85B7227189:3:
--
2.2.0