1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2015-05-07 15:42:00 +02:00
parent d0d4984cfe
commit 436f206072
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -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