aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-05-07 13:42:00 +0000
committerWerner Koch <[email protected]>2015-05-07 13:42:00 +0000
commit436f2060721e997479a9dd5be8dfc73627dd49c9 (patch)
tree41f117605e5b4c0da73a0c7d2ae361e570b42986
parentdirmngr: Fix segfault in ldap engine (diff)
downloadgnupg-436f2060721e997479a9dd5be8dfc73627dd49c9.tar.gz
gnupg-436f2060721e997479a9dd5be8dfc73627dd49c9.zip
agent: Minor change for 56b5c9f.
* agent/call-pinentry.c (agent_askpin): Move option setting to ... (start_pinentry): here. Fix error code check. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--agent/call-pinentry.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index 77b173934..0a0f95be8 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -407,6 +407,20 @@ start_pinentry (ctrl_t ctrl)
return unlock_pinentry (rc);
}
+
+ /* Indicate to the pinentry that it may read from an external cache.
+
+ It is essential that the pinentry respect this. If the cached
+ password is not up to date and retry == 1, then, using a version
+ of GPG Agent that doesn't support this, won't issue another pin
+ request and the user won't get a chance to correct the
+ password. */
+ rc = assuan_transact (entry_ctx, "OPTION allow-external-password-cache",
+ NULL, NULL, NULL, NULL, NULL, NULL);
+ if (rc && gpg_err_code (rc) != GPG_ERR_UNKNOWN_OPTION)
+ return unlock_pinentry (rc);
+
+
{
/* Provide a few default strings for use by the pinentries. This
may help a pinentry to avoid implementing localization code. */
@@ -814,18 +828,6 @@ agent_askpin (ctrl_t ctrl,
if (rc)
return rc;
- /* Indicate to the pinentry that it may read from an external cache.
-
- It is essential that the pinentry respect this. If the cached
- password is not up to date and retry == 1, then, using a version
- of GPG Agent that doesn't support this, won't issue another pin
- request and the user won't get a chance to correct the
- password. */
- rc = assuan_transact (entry_ctx, "OPTION allow-external-password-cache",
- NULL, NULL, NULL, NULL, NULL, NULL);
- if (rc && gpg_err_code (rc) != GPG_ERR_ASS_UNKNOWN_CMD)
- return unlock_pinentry (rc);
-
/* If we have a KEYINFO string and are normal, user, or ssh cache
mode, we tell that the Pinentry so it may use it for own caching
purposes. Most pinentries won't have this implemented and thus