X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshrand.c;h=0fbefb48370179f7b6b3fdf3bcd24c014dc0b6c6;hb=1de7240eb88fa24a8532ded116b4ec72dd213008;hp=ead39a9bdad917ec144faddd1ee4df1ec2cd22fd;hpb=ab2ddd17720529ddc79c353372a5cb15713354d5;p=PuTTY.git diff --git a/sshrand.c b/sshrand.c index ead39a9b..0fbefb48 100644 --- a/sshrand.c +++ b/sshrand.c @@ -45,8 +45,23 @@ struct RandPool { int stir_pending; }; -static struct RandPool pool; int random_active = 0; + +#ifdef FUZZING +/* + * Special dummy version of the RNG for use when fuzzing. + */ +void random_add_noise(void *noise, int length) { } +void random_add_heavynoise(void *noise, int length) { } +void random_ref(void) { } +void random_unref(void) { } +int random_byte(void) +{ + return 0x45; /* Chosen by eight fair coin tosses */ +} +void random_get_savedata(void **data, int *len) { } +#else /* !FUZZING */ +static struct RandPool pool; long next_noise_collection; #ifdef RANDOM_DIAGNOSTICS @@ -326,3 +341,4 @@ void random_get_savedata(void **data, int *len) *data = buf; random_stir(); } +#endif