From 73439ad0ff5363ad629086fe04ac44f5569a185e Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 27 Mar 2022 06:46:04 +0000 Subject: Don't write to /dev/urandom. (It's useless or even harmful.) --- src/librandom/random_init.c | 4 ---- src/librandom/random_makeseed.c | 4 +--- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/librandom/random_init.c b/src/librandom/random_init.c index 72671df..cd880e8 100644 --- a/src/librandom/random_init.c +++ b/src/librandom/random_init.c @@ -47,11 +47,7 @@ int random_fd = -1 ; int random_init () { - char seed[160] ; if (random_fd >= 0) return 1 ; - random_makeseed(seed) ; - surf_init(&surf_here, seed) ; - openwritenclose_unsafe("/dev/urandom", seed, 160) ; random_fd = openc_readb("/dev/urandom") ; return random_fd >= 0 ; } diff --git a/src/librandom/random_makeseed.c b/src/librandom/random_makeseed.c index c15ad5a..9c518cf 100644 --- a/src/librandom/random_makeseed.c +++ b/src/librandom/random_makeseed.c @@ -9,9 +9,7 @@ /* Writes 160 bytes of crap into s. Certainly not cryptographically secure or 100% unpredictable, - but we're only using this to help shuffle the entropy of - /dev/urandom or to init an internal SURF PRNG. - iow: we are CS iff the system's RNG is CS. + but we're only using this to seed an internal PRNG. */ void random_makeseed (char *s) -- cgit v1.2.3