diff options
author | Marcus Brinkmann <mb@g10code.com> | 2002-04-25 01:18:53 +0200 |
---|---|---|
committer | Marcus Brinkmann <mb@g10code.com> | 2002-04-25 01:18:53 +0200 |
commit | b4f8fcb0e11a5079783b6a95d7c9a80b49d886b9 (patch) | |
tree | d8ca7d236377df0b8afd10cfee0716a5e90b6208 /agent | |
parent | 2002-04-25 Marcus Brinkmann <marcus@g10code.de> (diff) | |
download | gnupg2-b4f8fcb0e11a5079783b6a95d7c9a80b49d886b9.tar.xz gnupg2-b4f8fcb0e11a5079783b6a95d7c9a80b49d886b9.zip |
2002-04-25 Marcus Brinkmann <marcus@g10code.de>
* agent.h (agent_get_confirmation): Replace paramter prompt with
two parameters ok and cancel.
* query.c (agent_get_confirmation): Likewise. Implement this.
* trustlist.c (agent_marktrusted): Fix invocation of
agent_get_confirmation.
* divert-scd.c (ask_for_card): Likewise.
Diffstat (limited to 'agent')
-rw-r--r-- | agent/ChangeLog | 9 | ||||
-rw-r--r-- | agent/agent.h | 3 | ||||
-rw-r--r-- | agent/divert-scd.c | 2 | ||||
-rw-r--r-- | agent/query.c | 14 | ||||
-rw-r--r-- | agent/trustlist.c | 4 |
5 files changed, 25 insertions, 7 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog index 96817c3f3..29e74bffa 100644 --- a/agent/ChangeLog +++ b/agent/ChangeLog @@ -1,3 +1,12 @@ +2002-04-25 Marcus Brinkmann <marcus@g10code.de> + + * agent.h (agent_get_confirmation): Replace paramter prompt with + two parameters ok and cancel. + * query.c (agent_get_confirmation): Likewise. Implement this. + * trustlist.c (agent_marktrusted): Fix invocation of + agent_get_confirmation. + * divert-scd.c (ask_for_card): Likewise. + 2002-04-24 Marcus Brinkmann <marcus@g10code.de> * agent.h (struct opt): Add members display, ttyname, ttytype, diff --git a/agent/agent.h b/agent/agent.h index b6bdb0caa..4dad5181c 100644 --- a/agent/agent.h +++ b/agent/agent.h @@ -119,7 +119,8 @@ int agent_askpin (const char *desc_text, const char *err_text, int agent_get_passphrase (char **retpass, const char *desc, const char *prompt, const char *errtext); -int agent_get_confirmation (const char *desc, const char *prompt); +int agent_get_confirmation (const char *desc, const char *ok, + const char *cancel); /*-- cache.c --*/ int agent_put_cache (const char *key, const char *data, int ttl); diff --git a/agent/divert-scd.c b/agent/divert-scd.c index dcfc35403..ba0fa6edf 100644 --- a/agent/divert-scd.c +++ b/agent/divert-scd.c @@ -119,7 +119,7 @@ ask_for_card (const unsigned char *shadow_info, char **r_kid) } else { - rc = agent_get_confirmation (desc, NULL); + rc = agent_get_confirmation (desc, NULL, NULL); free (desc); } } diff --git a/agent/query.c b/agent/query.c index 4243f0026..c7e05a099 100644 --- a/agent/query.c +++ b/agent/query.c @@ -353,7 +353,7 @@ agent_get_passphrase (char **retpass, const char *desc, const char *prompt, confirmed it, GNUPG_Not_Confirmed for what the text says or an other error. */ int -agent_get_confirmation (const char *desc, const char *prompt) +agent_get_confirmation (const char *desc, const char *ok, const char *cancel) { int rc; char line[ASSUAN_LINELENGTH]; @@ -371,9 +371,17 @@ agent_get_confirmation (const char *desc, const char *prompt) if (rc) return map_assuan_err (rc); - if (prompt) + if (ok) { - snprintf (line, DIM(line)-1, "SETPROMPT %s", prompt); + snprintf (line, DIM(line)-1, "SETOK %s", ok); + line[DIM(line)-1] = 0; + rc = assuan_transact (entry_ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); + if (rc) + return map_assuan_err (rc); + } + if (cancel) + { + snprintf (line, DIM(line)-1, "SETCANCEL %s", cancel); line[DIM(line)-1] = 0; rc = assuan_transact (entry_ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); if (rc) diff --git a/agent/trustlist.c b/agent/trustlist.c index d3b8b6d20..b6545f7de 100644 --- a/agent/trustlist.c +++ b/agent/trustlist.c @@ -254,7 +254,7 @@ agent_marktrusted (const char *name, const char *fpr, int flag) "has the fingerprint:%%0A" " %s", name, fpr) < 0 ) return GNUPG_Out_Of_Core; - rc = agent_get_confirmation (desc, "Correct|No"); + rc = agent_get_confirmation (desc, "Correct", "No"); free (desc); if (rc) return rc; @@ -265,7 +265,7 @@ agent_marktrusted (const char *name, const char *fpr, int flag) "to correctly certify user certificates?", name) < 0 ) return GNUPG_Out_Of_Core; - rc = agent_get_confirmation (desc, "Yes|No"); + rc = agent_get_confirmation (desc, "Yes", "No"); free (desc); if (rc) return rc; |