Hack to start thye agent as a side-effect of a secret key listing.
authorWerner Koch <wk@gnupg.org>
Tue, 9 Mar 2010 09:43:54 +0000 (09:43 +0000)
committerWerner Koch <wk@gnupg.org>
Tue, 9 Mar 2010 09:43:54 +0000 (09:43 +0000)
ChangeLog
Makefile.am
patches/gpgme-1.2.0/04-check-agent.patch [new file with mode: 0755]

index 9abdb3e..70223e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-03-09  Werner Koch  <wk@g10code.com>
+
+       * patches/gpgme-1.2.0/04-check-agent.patch: New.
+       * Makefile.am (EXTRA_DIST): Add patch.
+
+2010-03-05  Werner Koch  <wk@g10code.com>
+
+       Release 2.0.2rc2.
+
 2010-03-04  Emanuel Schuetze  <emanuel.schuetze@intevation.de>
 
        * News: Update kleopatra version number.
index bbe52c2..2feca44 100644 (file)
@@ -35,6 +35,7 @@ EXTRA_DIST = autogen.sh README.SVN ONEWS \
         patches/gpgme-1.2.0/01-w32-io-threads.patch \
        patches/gpgme-1.2.0/02-inv-signer.patch \
        patches/gpgme-1.2.0/03-w32-socket.patch \
+        patches/gpgme-1.2.0/04-check-agent.patch \
        patches/winpt/01-gpg-path.patch \
        patches/gpgex/01-no-checksums.patch \
        patches/gpgex-0.9.5/01-default-no-suffix.patch \
diff --git a/patches/gpgme-1.2.0/04-check-agent.patch b/patches/gpgme-1.2.0/04-check-agent.patch
new file mode 100755 (executable)
index 0000000..8674cf6
--- /dev/null
@@ -0,0 +1,31 @@
+#! /bin/sh
+patch -p0 -f $* < $0
+exit $?
+
+2010-03-09  Werner Koch  <wk@g10code.com>
+
+       * engine-gpgsm.c (gpgsm_keylist): Try to start the agent.
+
+
+--- src/engine-gpgsm.c (revision 1450)
++++ src/engine-gpgsm.c (working copy)
+@@ -1538,6 +1538,18 @@
+   if (!pattern)
+     pattern = "";
++  /* Hack to make sure that the agent is started.  Only if the agent
++     has been started an application may connect to the agent via
++     GPGME_PROTOCOL_ASSUAN - for example to look for smartcards.  We
++     do this only if a secret key listing has been requested.  In
++     general this is not needed because a secret key listing starts
++     the agent.  However on a fresh installation no public keys are
++     available and thus there is no need for gpgsm to ask the agent
++     whether a secret key exists for the public key.  */
++  if (secret_only)
++    gpgsm_assuan_simple_command (gpgsm->assuan_ctx, "GETINFO agent-check",
++                                 NULL, NULL);
++
+   /* Always send list-mode option because RESET does not reset it.  */
+   if (asprintf (&line, "OPTION list-mode=%d", (list_mode & 3)) < 0)
+     return gpg_error_from_errno (errno);
+