diff options
author | Werner Koch <[email protected]> | 2002-01-31 16:38:45 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2002-01-31 16:38:45 +0000 |
commit | 7d9ed16fe6bfbb80755b2dba983e58435088bc63 (patch) | |
tree | 76ff1323a1d60163dca3d2de431eaa3cbeac9e64 /agent/query.c | |
parent | A few test certificates (diff) | |
download | gnupg-7d9ed16fe6bfbb80755b2dba983e58435088bc63.tar.gz gnupg-7d9ed16fe6bfbb80755b2dba983e58435088bc63.zip |
* genkey.c (store_key): Protect the key.
(agent_genkey): Ask for the passphrase.
* findkey.c (unprotect): Actually unprotect the key.
* query.c (agent_askpin): Add an optional start_err_text.
Diffstat (limited to 'agent/query.c')
-rw-r--r-- | agent/query.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/agent/query.c b/agent/query.c index fcee18c2a..3b8cd08df 100644 --- a/agent/query.c +++ b/agent/query.c @@ -137,13 +137,13 @@ all_digitsp( const char *s) number here and repeat it as long as we have invalid formed numbers. */ int -agent_askpin (const char *desc_text, +agent_askpin (const char *desc_text, const char *start_err_text, struct pin_entry_info_s *pininfo) { int rc; char line[ASSUAN_LINELENGTH]; struct entry_parm_s parm; - const char *errtext = NULL; + const char *errtext = start_err_text; if (opt.batch) return 0; /* fixme: we should return BAD PIN */ @@ -180,8 +180,14 @@ agent_askpin (const char *desc_text, if (errtext) { /* fixme: should we show the try count? It must be translated */ - snprintf (line, DIM(line)-1, "SETERROR %s (try %d of %d)", - errtext, pininfo->failed_tries+1, pininfo->max_tries); + if (start_err_text) + { + snprintf (line, DIM(line)-1, "SETERROR %s", errtext); + start_err_text = NULL; + } + else + 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); if (rc) |