X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/9c6214334f866ab91173df992180e168c17f904d..7d6ee6ff291302d003f6f6cc6d11cede050c1c87:/sshrand.c diff --git a/sshrand.c b/sshrand.c index 84c3e91e..3e0a0a8b 100644 --- a/sshrand.c +++ b/sshrand.c @@ -39,6 +39,7 @@ struct RandPool { }; static struct RandPool pool; +static int random_active = 0; void random_stir(void) { word32 block[HASHINPUT/sizeof(word32)]; @@ -114,6 +115,9 @@ void random_add_noise(void *noise, int length) { unsigned char *p = noise; int i; + if (!random_active) + return; + /* * This function processes HASHINPUT bytes into only HASHSIZE * bytes, so _if_ we were getting incredibly high entropy @@ -176,6 +180,8 @@ static void random_add_heavynoise_bitbybit(void *noise, int length) { void random_init(void) { memset(&pool, 0, sizeof(pool)); /* just to start with */ + random_active = 1; + noise_get_heavy(random_add_heavynoise_bitbybit); }