X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshrand.c;h=524bbd43e57072584f9f9c2b7466a7cb2e474100;hb=53b1ea39510aa5201c3fde7f81d59220b5c3540d;hp=95c7b49255c709cb6d0d94e84a313b836698dbce;hpb=07823298cf1ad9844467ddbc2d67b1ff6ba19a09;p=PuTTY_svn.git diff --git a/sshrand.c b/sshrand.c index 95c7b492..524bbd43 100644 --- a/sshrand.c +++ b/sshrand.c @@ -2,6 +2,7 @@ * cryptographic random number generator for PuTTY's ssh client */ +#include "putty.h" #include "ssh.h" void noise_get_heavy(void (*func) (void *, int)); @@ -41,7 +42,7 @@ struct RandPool { static struct RandPool pool; int random_active = 0; -void random_stir(void) +static void random_stir(void) { word32 block[HASHINPUT / sizeof(word32)]; word32 digest[HASHSIZE / sizeof(word32)]; @@ -201,7 +202,7 @@ int random_byte(void) void random_get_savedata(void **data, int *len) { - void *buf = smalloc(POOLSIZE / 2); + void *buf = snewn(POOLSIZE / 2, char); random_stir(); memcpy(buf, pool.pool + pool.poolpos, POOLSIZE / 2); *len = POOLSIZE / 2;