X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/c44bf5bd7bf680c21356864ac5ae72ab29e55ce6..7440fd4419acfc9c784f142fb9dee3e64c9a18c2:/pageant.c diff --git a/pageant.c b/pageant.c index e8428b03..9d39e46d 100644 --- a/pageant.c +++ b/pageant.c @@ -2,10 +2,6 @@ * Pageant: the PuTTY Authentication Agent. */ -#include -#ifndef NO_SECURITY -#include -#endif #include #include #include @@ -16,7 +12,10 @@ #include "ssh.h" #include "misc.h" #include "tree234.h" -#include "winstuff.h" + +#ifndef NO_SECURITY +#include +#endif #define IDI_MAINICON 200 #define IDI_TRAYICON 201 @@ -416,7 +415,7 @@ static void add_keyfile(Filename filename) int i, nkeys, bloblen; if (type == SSH_KEYTYPE_SSH1) { - if (!rsakey_pubblob(&filename, &blob, &bloblen)) { + if (!rsakey_pubblob(&filename, &blob, &bloblen, NULL)) { MessageBox(NULL, "Couldn't load private key.", APPNAME, MB_OK | MB_ICONERROR); return; @@ -424,7 +423,7 @@ static void add_keyfile(Filename filename) keylist = get_keylist1(); } else { unsigned char *blob2; - blob = ssh2_userkey_loadpub(&filename, NULL, &bloblen); + blob = ssh2_userkey_loadpub(&filename, NULL, &bloblen, NULL); if (!blob) { MessageBox(NULL, "Couldn't load private key.", APPNAME, MB_OK | MB_ICONERROR); @@ -498,9 +497,9 @@ static void add_keyfile(Filename filename) } else *passphrase = '\0'; if (type == SSH_KEYTYPE_SSH1) - ret = loadrsakey(&filename, rkey, passphrase); + ret = loadrsakey(&filename, rkey, passphrase, NULL); else { - skey = ssh2_load_userkey(&filename, passphrase); + skey = ssh2_load_userkey(&filename, passphrase, NULL); if (skey == SSH2_WRONG_PASSPHRASE) ret = -1; else if (!skey) @@ -1810,7 +1809,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) { WNDCLASS wndclass; MSG msg; - OSVERSIONINFO osi; HMODULE advapi; char *command = NULL; int added_keys = 0; @@ -1821,9 +1819,11 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) * Determine whether we're an NT system (should have security * APIs) or a non-NT system (don't do security). */ - memset(&osi, 0, sizeof(OSVERSIONINFO)); - osi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (GetVersionEx(&osi) && osi.dwPlatformId == VER_PLATFORM_WIN32_NT) { + if (!init_winver()) + { + modalfatalbox("Windows refuses to report a version"); + } + if (osVersion.dwPlatformId == VER_PLATFORM_WIN32_NT) { has_security = TRUE; } else has_security = FALSE;