X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/4a4b36177579a15b96b61610369121326481dde5..b492c4d75bec08565e126e548888d40ba921e9a5:/pageant.c diff --git a/pageant.c b/pageant.c index 41ae837e..c401ea55 100644 --- a/pageant.c +++ b/pageant.c @@ -128,6 +128,24 @@ static void *get_keylist1(void); static void *get_keylist2(void); /* + * We need this to link with the RSA code, because rsaencrypt() + * pads its data with random bytes. Since we only use rsadecrypt() + * and the signing functions, which are deterministic, this should + * never be called. + * + * If it _is_ called, there is a _serious_ problem, because it + * won't generate true random numbers. So we must scream, panic, + * and exit immediately if that should happen. + */ +int random_byte(void) +{ + MessageBox(main_hwnd, "Internal Error", APPNAME, MB_OK | MB_ICONERROR); + exit(0); + /* this line can't be reached but it placates MSVC's warnings :-) */ + return 0; +} + +/* * Blob structure for passing to the asymmetric SSH2 key compare * function, prototyped here. */ @@ -1930,11 +1948,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) } /* - * Initialise the random number generator. - */ - random_init(); - - /* * Initialise storage for short-term passphrase cache. */ passphrases = newtree234(NULL);