aboutsummaryrefslogtreecommitdiffstats
path: root/agent/divert-scd.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/divert-scd.c')
-rw-r--r--agent/divert-scd.c48
1 files changed, 35 insertions, 13 deletions
diff --git a/agent/divert-scd.c b/agent/divert-scd.c
index b85b490c1..b9781547d 100644
--- a/agent/divert-scd.c
+++ b/agent/divert-scd.c
@@ -195,7 +195,7 @@ has_percent0A_suffix (const char *string)
string with the passphrase, the buffer may optionally be padded
with arbitrary characters.
- If DESC_TEXT is not NULL it can be used as further informtion shown
+ If DESC_TEXT is not NULL it can be used as further information shown
atop of the INFO message.
INFO gets displayed as part of a generic string. However if the
@@ -278,25 +278,47 @@ getpin_cb (void *opaque, const char *desc_text, const char *info,
{
if (info)
{
- char *desc, *desc2;
+ char *desc;
+ const char *desc2;
- if ( asprintf (&desc,
- L_("%s%%0A%%0AUse the reader's pinpad for input."),
- info) < 0 )
- rc = gpg_error_from_syserror ();
+ if (!strcmp (info, "--ack"))
+ {
+ desc2 = L_("Push ACK button on card/token.");
+
+ if (desc_text)
+ {
+ desc = strconcat (desc_text,
+ has_percent0A_suffix (desc_text)
+ ? "%0A" : "%0A%0A",
+ desc2, NULL);
+ desc2 = NULL;
+ }
+ else
+ desc = NULL;
+ }
else
{
- /* Prepend DESC_TEXT to INFO. */
+ desc2 = NULL;
+
if (desc_text)
- desc2 = strconcat (desc_text,
- has_percent0A_suffix (desc_text)
- ? "%0A" : "%0A%0A",
- desc, NULL);
+ desc = strconcat (desc_text,
+ has_percent0A_suffix (desc_text)
+ ? "%0A" : "%0A%0A",
+ info, "%0A%0A",
+ L_("Use the reader's pinpad for input."),
+ NULL);
else
- desc2 = NULL;
+ desc = strconcat (info, "%0A%0A",
+ L_("Use the reader's pinpad for input."),
+ NULL);
+ }
+
+ if (!desc2 && !desc)
+ rc = gpg_error_from_syserror ();
+ else
+ {
rc = agent_popup_message_start (ctrl,
desc2? desc2:desc, NULL);
- xfree (desc2);
xfree (desc);
}
}