mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
Set both the app and default SCD pin prompt at the same time.
Fixes the case when scdaemon prompts for card insertion. * scd/app-openpgp.c (do_set_pin_prompt): Fix indentation. No longer unset the prompt with '-' since the OPTION command without a value does this anyway. * scd/app.c (expand_pin_prompt): Fix indentation. * scd/command.c (set_pinentry_prompt): Set both the default and application prompt when available.
This commit is contained in:
parent
633ea8531e
commit
b5aa197a5f
@ -3780,7 +3780,7 @@ do_set_pin_prompt(app_t app, int which, const char *prompt)
|
|||||||
xfree (*p);
|
xfree (*p);
|
||||||
*p = NULL;
|
*p = NULL;
|
||||||
|
|
||||||
if (prompt && *prompt != '-' && *(prompt+1) != 0)
|
if (prompt && *prompt)
|
||||||
{
|
{
|
||||||
*p = xtrystrdup (prompt);
|
*p = xtrystrdup (prompt);
|
||||||
if (!*p)
|
if (!*p)
|
||||||
|
@ -395,9 +395,10 @@ reset_notify (assuan_context_t ctx, char *line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gpg_error_t
|
static gpg_error_t
|
||||||
set_pinentry_prompt(struct server_local_s *srv, int which, const char *prompt)
|
set_pinentry_prompt(ctrl_t ctrl, int which, const char *prompt)
|
||||||
{
|
{
|
||||||
gpg_error_t rc = 0;
|
gpg_error_t rc = 0;
|
||||||
|
struct server_local_s *srv = ctrl->server_local;
|
||||||
char **p = NULL;
|
char **p = NULL;
|
||||||
|
|
||||||
switch (which)
|
switch (which)
|
||||||
@ -417,7 +418,7 @@ set_pinentry_prompt(struct server_local_s *srv, int which, const char *prompt)
|
|||||||
xfree (*p);
|
xfree (*p);
|
||||||
*p = NULL;
|
*p = NULL;
|
||||||
|
|
||||||
if (prompt && *prompt != '-' && *(prompt+1) != 0)
|
if (prompt && *prompt)
|
||||||
{
|
{
|
||||||
*p = xtrystrdup (prompt);
|
*p = xtrystrdup (prompt);
|
||||||
if (!*p)
|
if (!*p)
|
||||||
@ -425,6 +426,9 @@ set_pinentry_prompt(struct server_local_s *srv, int which, const char *prompt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!rc && ctrl->app_ctx)
|
||||||
|
rc = app_set_pin_prompt (ctrl->app_ctx, PIN_SIGN_PROMPT, prompt);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -451,17 +455,11 @@ option_handler (assuan_context_t ctx, const char *key, const char *value)
|
|||||||
* app.c:expand_pin_prompt() for details. */
|
* app.c:expand_pin_prompt() for details. */
|
||||||
else if (!strcmp (key, "pin-prompt"))
|
else if (!strcmp (key, "pin-prompt"))
|
||||||
{
|
{
|
||||||
if (ctrl->app_ctx)
|
return set_pinentry_prompt (ctrl, PIN_SIGN_PROMPT, value);
|
||||||
return app_set_pin_prompt (ctrl->app_ctx, PIN_SIGN_PROMPT, value);
|
|
||||||
else
|
|
||||||
return set_pinentry_prompt (ctrl->server_local, PIN_SIGN_PROMPT, value);
|
|
||||||
}
|
}
|
||||||
else if (!strcmp (key, "pin-admin-prompt"))
|
else if (!strcmp (key, "pin-admin-prompt"))
|
||||||
{
|
{
|
||||||
if (ctrl->app_ctx)
|
return set_pinentry_prompt (ctrl, PIN_ADMIN_PROMPT, value);
|
||||||
return app_set_pin_prompt (ctrl->app_ctx, PIN_ADMIN_PROMPT, value);
|
|
||||||
else
|
|
||||||
return set_pinentry_prompt (ctrl->server_local, PIN_ADMIN_PROMPT, value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user