diff options
author | Werner Koch <[email protected]> | 2004-02-21 13:05:22 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2004-02-21 13:05:22 +0000 |
commit | a425334f4884a6cd5f95976cf1d0950305f40691 (patch) | |
tree | c5eefffb95391be28015dc8a8a477797911e6ccb /agent/query.c | |
parent | Fixed URLs in the notice messages. (diff) | |
download | gnupg-a425334f4884a6cd5f95976cf1d0950305f40691.tar.gz gnupg-a425334f4884a6cd5f95976cf1d0950305f40691.zip |
* command.c (cmd_passwd): Take acount of a key description.
* genkey.c (reenter_compare_cb): Do not set the error text.
(agent_protect_and_store, agent_genkey): Force a re-enter after a
non-matching passphrase.
* query.c (agent_askpin): Add new arg INITIAL_ERRTEXT; changed
all callers.
Diffstat (limited to '')
-rw-r--r-- | agent/query.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/agent/query.c b/agent/query.c index 28873775a..145aaca00 100644 --- a/agent/query.c +++ b/agent/query.c @@ -250,7 +250,8 @@ all_digitsp( const char *s) numbers. */ int agent_askpin (CTRL ctrl, - const char *desc_text, struct pin_entry_info_s *pininfo) + const char *desc_text, const char *initial_errtext, + struct pin_entry_info_s *pininfo) { int rc; char line[ASSUAN_LINELENGTH]; @@ -289,6 +290,17 @@ agent_askpin (CTRL ctrl, if (rc) return unlock_pinentry (map_assuan_err (rc)); + + if (initial_errtext) + { + snprintf (line, DIM(line)-1, "SETERROR %s", initial_errtext); + line[DIM(line)-1] = 0; + rc = assuan_transact (entry_ctx, line, + NULL, NULL, NULL, NULL, NULL, NULL); + if (rc) + return unlock_pinentry (map_assuan_err (rc)); + } + for (;pininfo->failed_tries < pininfo->max_tries; pininfo->failed_tries++) { memset (&parm, 0, sizeof parm); @@ -301,7 +313,8 @@ agent_askpin (CTRL ctrl, snprintf (line, DIM(line)-1, "SETERROR %s (try %d of %d)", errtext, pininfo->failed_tries+1, pininfo->max_tries); line[DIM(line)-1] = 0; - rc = assuan_transact (entry_ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); + rc = assuan_transact (entry_ctx, line, + NULL, NULL, NULL, NULL, NULL, NULL); if (rc) return unlock_pinentry (map_assuan_err (rc)); errtext = NULL; |