diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-25 17:52:53 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-25 17:52:53 +0000 |
| commit | 32a18b39447d8f055465ee783c7543c8002cc518 (patch) | |
| tree | 3127d7ab0eeadab932fb1299f610d582b5da511d /util/libreboot-utils/lib/mkhtemp.c | |
| parent | 79f2dd197f2d021e886ed9818f75a14934b88e89 (diff) | |
libreboot-utils: tidy up rand
also re-add /dev/urandom support, as a config option
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/mkhtemp.c')
| -rw-r--r-- | util/libreboot-utils/lib/mkhtemp.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; |
