mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
util/nvmutil: remove /dev/random fallback
only use the old fallback, or /dev/urandom /dev/random blocks on some older unix machines, or in embedded environments that may never have enough entropy, causing the code to hang. urandom is most certainly expected to exist on pretty much anything since the mid 90s. i could probably re-add the arc4random setup for BSDs. i'll think about it. gotta do that portably too. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -263,7 +263,6 @@ static void usage(uint8_t usage_exit);
|
||||
#define items(x) (sizeof((x)) / sizeof((x)[0]))
|
||||
|
||||
static const char newrandom[] = "/dev/urandom";
|
||||
static const char oldrandom[] = "/dev/random"; /* fallback on OLD unix */
|
||||
static const char *rname = NULL;
|
||||
|
||||
/*
|
||||
@@ -723,11 +722,6 @@ open_dev_urandom(void)
|
||||
if (urandom_fd != -1)
|
||||
return;
|
||||
|
||||
rname = oldrandom;
|
||||
urandom_fd = open(rname, O_RDONLY);
|
||||
if (urandom_fd != -1)
|
||||
return;
|
||||
|
||||
/* fallback on VERY VERY VERY old unix */
|
||||
use_prng = 1;
|
||||
srand((unsigned)(time(NULL) ^ getpid()));
|
||||
|
||||
Reference in New Issue
Block a user