aboutsummaryrefslogtreecommitdiffstats
path: root/tests/start-stop-agent
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-03-20 15:36:27 +0000
committerJustus Winter <[email protected]>2017-03-20 15:41:43 +0000
commit16b202d9999591b71fb8bb49f6db10ef96d4cbe8 (patch)
tree9f38b74a976a32b91066b1c401fa5de2a21ce5b6 /tests/start-stop-agent
parentpython: Skip tests if GnuPG is too old. (diff)
downloadgpgme-16b202d9999591b71fb8bb49f6db10ef96d4cbe8.tar.gz
gpgme-16b202d9999591b71fb8bb49f6db10ef96d4cbe8.zip
tests: Use 'gpg-agent --allow-loopback-pinentry' if applicable.
* lang/python/tests/Makefile.am (gpg-agent.conf): Do not hard-code the option. This breaks gpg-agent from GnuPG 2.0. * tests/start-stop-agent: Rather, check if the option is supported and add it to the configuration if it is. GnuPG-bug-id: 3008 Fixes-commit: bbf19124bbec9eb6298cef2914baae7ac74382fe Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'tests/start-stop-agent')
-rwxr-xr-xtests/start-stop-agent8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/start-stop-agent b/tests/start-stop-agent
index e843ce5c..457f70d7 100755
--- a/tests/start-stop-agent
+++ b/tests/start-stop-agent
@@ -38,6 +38,14 @@ fi
echo "starting gpg-agent.." >&2
+# GnuPG prior to 2.1.12 needs --allow-loopback-pinentry for the
+# loopback entry to work. Old versions do not understand this though,
+# so we need to be careful.
+if "$GPG_AGENT" --gpgconf-test --allow-loopback-pinentry &&
+ ! grep -q allow-loopback-pinentry "$GNUPGHOME/gpg-agent.conf"; then
+ echo allow-loopback-pinentry >> "$GNUPGHOME/gpg-agent.conf"
+fi
+
gpg-connect-agent --agent-program="${GPG_AGENT}|--debug-quick-random" putval\ $token\ set /bye
if [ $? -ne 0 -o "$(gpg-connect-agent getval\ $token /bye 2>/dev/null | head -1)" \
!= "D set" ]; then