1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-14 17:47:33 -05:00

Pageant now accepts an initial key list on the command line

[originally from svn r592]
This commit is contained in:
Simon Tatham
2000-09-15 10:48:42 +00:00
parent 4bd19700a1
commit c96384efe0
3 changed files with 163 additions and 17 deletions

View File

@ -21,8 +21,6 @@
#define APPNAME "Pageant"
#define MAILSLOTNAME "\\\\.\\mailslot\\pageant_listener"
#define SSH_AGENTC_REQUEST_RSA_IDENTITIES 1
#define SSH_AGENT_RSA_IDENTITIES_ANSWER 2
#define SSH_AGENTC_RSA_CHALLENGE 3
@ -513,7 +511,6 @@ static LRESULT CALLBACK WndProc (HWND hwnd, UINT message,
int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
WNDCLASS wndclass;
HANDLE mailslot;
MSG msg;
instance = inst;
@ -572,22 +569,31 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) {
ShowWindow (hwnd, SW_HIDE);
/*
* Create the mailslot.
*/
{
SECURITY_ATTRIBUTES sa;
sa.nLength = sizeof(sa);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
mailslot = CreateMailslot(MAILSLOTNAME, 0, 0, &sa);
}
/*
* Initialise storage for RSA keys.
*/
rsakeys = newtree234(cmpkeys);
/*
* Process the command line and add RSA keys as listed on it.
* FIXME: we don't support spaces in filenames here. We should.
*/
{
char *p = cmdline;
while (*p) {
while (*p && isspace(*p)) p++;
if (*p && !isspace(*p)) {
char *q = p;
while (*p && !isspace(*p)) p++;
if (*p) *p++ = '\0';
add_keyfile(q);
}
}
}
/*
* Main message loop.
*/
while (GetMessage(&msg, NULL, 0, 0) == 1) {
TranslateMessage(&msg);
DispatchMessage(&msg);