From 00b56c0278966edfd2acc29e55efac734982013e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 25 Mar 2026 17:52:53 +0000 Subject: libreboot-utils: tidy up rand also re-add /dev/urandom support, as a config option Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/mkhtemp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'util/libreboot-utils/lib/mkhtemp.c') diff --git a/util/libreboot-utils/lib/mkhtemp.c b/util/libreboot-utils/lib/mkhtemp.c index 191d657c..d22f526a 100644 --- a/util/libreboot-utils/lib/mkhtemp.c +++ b/util/libreboot-utils/lib/mkhtemp.c @@ -903,11 +903,12 @@ mkhtemp_fill_random(char *p, size_t xc) for (chx = 0; chx < xc; chx++) { retry_rand: - /* on bsd: uses arc4random - on linux: uses getrandom - *never returns error* + /* /dev/urandom if enabled, OR: + * on bsd: uses arc4random + * on linux: uses getrandom + NOTE: *aborts* on error, regardless of method */ - r = rlong(); /* always returns successful */ + r = rlong(); /* always *returns* successfully */ if (r >= limit) goto retry_rand; -- cgit v1.2.1