aboutsummaryrefslogtreecommitdiffstats
path: root/agent/query.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2005-05-24 12:37:36 +0000
committerWerner Koch <[email protected]>2005-05-24 12:37:36 +0000
commite96af3715b9b126b435c7887e47a660a73bf237b (patch)
tree2cc95e397aa1a3f65016a0b8c15546f430e10060 /agent/query.c
parent* Makefile.am: Do not build sc-copykeys anymore. (diff)
downloadgnupg-e96af3715b9b126b435c7887e47a660a73bf237b.tar.gz
gnupg-e96af3715b9b126b435c7887e47a660a73bf237b.zip
* call-scd.c (inq_needpin): Skip leading spaces in of PIN
description. * divert-scd.c (getpin_cb): Enhanced to cope with description flags. * query.c (agent_askpin): Add arg PROMPT_TEXT. Changed all callers.
Diffstat (limited to 'agent/query.c')
-rw-r--r--agent/query.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/agent/query.c b/agent/query.c
index 622a2662c..d3b42a416 100644
--- a/agent/query.c
+++ b/agent/query.c
@@ -288,8 +288,9 @@ all_digitsp( const char *s)
number here and repeat it as long as we have invalid formed
numbers. */
int
-agent_askpin (CTRL ctrl,
- const char *desc_text, const char *initial_errtext,
+agent_askpin (ctrl_t ctrl,
+ const char *desc_text, const char *prompt_text,
+ const char *initial_errtext,
struct pin_entry_info_s *pininfo)
{
int rc;
@@ -310,7 +311,10 @@ agent_askpin (CTRL ctrl,
desc_text = _("Please enter your passphrase, so that the secret key "
"can be unlocked for this session");
- is_pin = desc_text && strstr (desc_text, "PIN");
+ if (prompt_text)
+ is_pin = !!strstr (prompt_text, "PIN");
+ else
+ is_pin = desc_text && strstr (desc_text, "PIN");
rc = start_pinentry (ctrl);
if (rc)
@@ -322,10 +326,10 @@ agent_askpin (CTRL ctrl,
if (rc)
return unlock_pinentry (map_assuan_err (rc));
- rc = assuan_transact (entry_ctx,
- is_pin? "SETPROMPT PIN:"
- : "SETPROMPT Passphrase:",
- NULL, NULL, NULL, NULL, NULL, NULL);
+ snprintf (line, DIM(line)-1, "SETPROMPT %s",
+ prompt_text? prompt_text : is_pin? "PIN:" : "Passphrase:");
+ 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));