From 1cee54ee2b6222671fcdeab3e182fba265ae1270 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 12 Mar 2026 14:26:54 +0000 Subject: 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 --- util/nvmutil/nvmutil.c | 6 ------ 1 file changed, 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())); -- cgit v1.2.1