mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 03:22:48 -05:00
Pageant: introduce an API for passphrase prompts.
This begins to head towards the goal of storing a key file encrypted in Pageant, and decrypting it on demand via a GUI prompt the first time a client requests a signature from it. That won't be a facility available in all situations, so we have to be able to return failure from the prompt. More precisely, there are two versions of this API, one in PageantClient and one in PageantListenerClient: the stream implementation of PageantClient implements the former API and hands it off to the latter. Windows Pageant has to directly implement both (but they will end up funnelling to the same function within winpgnt.c). NFC: for the moment, the new API functions are never called, and every implementation of them returns failure.
This commit is contained in:
@ -792,9 +792,17 @@ static void wm_copydata_got_response(
|
||||
SetEvent(wmct.ev_reply_ready);
|
||||
}
|
||||
|
||||
static bool wm_copydata_ask_passphrase(
|
||||
PageantClient *pc, PageantClientDialogId *dlgid, const char *msg)
|
||||
{
|
||||
/* FIXME: we don't yet support dialog boxes */
|
||||
return false;
|
||||
}
|
||||
|
||||
static const PageantClientVtable wmcpc_vtable = {
|
||||
NULL, /* no logging in this client */
|
||||
wm_copydata_got_response,
|
||||
wm_copydata_ask_passphrase,
|
||||
};
|
||||
|
||||
static char *answer_filemapping_message(const char *mapname)
|
||||
@ -1176,11 +1184,19 @@ void cleanup_exit(int code)
|
||||
exit(code);
|
||||
}
|
||||
|
||||
static bool winpgnt_listener_ask_passphrase(
|
||||
PageantListenerClient *plc, PageantClientDialogId *dlgid, const char *msg)
|
||||
{
|
||||
/* FIXME: we don't yet support dialog boxes */
|
||||
return false;
|
||||
}
|
||||
|
||||
struct winpgnt_client {
|
||||
PageantListenerClient plc;
|
||||
};
|
||||
static const PageantListenerClientVtable winpgnt_vtable = {
|
||||
NULL, /* no logging */
|
||||
winpgnt_listener_ask_passphrase,
|
||||
};
|
||||
|
||||
static struct winpgnt_client wpc[1];
|
||||
|
Reference in New Issue
Block a user