diff options
author | Werner Koch <[email protected]> | 2010-03-09 11:15:53 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2010-03-09 11:15:53 +0000 |
commit | 113b8e15362665ce127ff4bda14521567a1eebff (patch) | |
tree | 30e82614f5f4755fce7ae7638b74d5871bf6abc8 /src | |
parent | Changed the close notify implementaion to allow for more than 256 fds. (diff) | |
download | gpgme-113b8e15362665ce127ff4bda14521567a1eebff.tar.gz gpgme-113b8e15362665ce127ff4bda14521567a1eebff.zip |
Hack to start the agent as a side-effect of a secret key listing
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/engine-gpgsm.c | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 57a09ff8..2582893e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2010-03-09 Werner Koch <[email protected]> + + * engine-gpgsm.c (gpgsm_keylist): Try to start the agent. + 2010-02-17 Werner Koch <[email protected]> * posix-io.c (notify_table): Change implementation. diff --git a/src/engine-gpgsm.c b/src/engine-gpgsm.c index 88039d7a..76760d56 100644 --- a/src/engine-gpgsm.c +++ b/src/engine-gpgsm.c @@ -1538,6 +1538,18 @@ gpgsm_keylist (void *engine, const char *pattern, int secret_only, 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); |