diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-12 14:26:54 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-12 14:26:54 +0000 |
| commit | 1cee54ee2b6222671fcdeab3e182fba265ae1270 (patch) | |
| tree | e56204e24161d1f6ddee98f5198b1b15d189e9bb /util | |
| parent | 1ad9ffb48288420dacab9c519c7b5646ae55d4be (diff) | |
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>
Diffstat (limited to 'util')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 06ef681f..e07efbb3 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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())); |
