1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-21 10:09:57 +01:00

Let the RESTART command reset any scdaemon pin prompts.

The gpg-agent sends the RESTART command to scdaemon when the client has
disconnected. This commit allows future connections to scdaemon use the
default pinentry prompts.

It is recommended to use the scdaemon LOCK command to prevent other
scdaemon clients from altering the prompts before the current client has
finished with the scdaemon pinentry since the set prompts are global to
the application.

* scd/command.c (cmd_restart): Free any allocated custom pinentry prompt
strings to let the application use its default.
This commit is contained in:
Ben Kibbey 2012-01-24 18:52:02 -05:00
parent 7a61398e67
commit 74fe0b79a1

View File

@ -142,7 +142,7 @@ struct server_local_s
/* User-defined pinentry prompt strings. Needed both here and in the app
* since they may be set by the user before an app is selected with
* select_application(). They are copied to the app when
* select_application() succeeds and further modifications done in the app.
* select_application() succeeds.
* */
char *pin_prompt;
char *pin_admin_prompt;
@ -1838,6 +1838,11 @@ cmd_restart (assuan_context_t ctx, char *line)
locked_session = NULL;
log_info ("implicitly unlocking due to RESTART\n");
}
xfree (ctrl->server_local->pin_prompt);
xfree (ctrl->server_local->pin_admin_prompt);
ctrl->server_local->pin_prompt = NULL;
ctrl->server_local->pin_admin_prompt = NULL;
return 0;
}