summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-18 05:18:23 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-18 05:18:23 +0000
commit5c51352cf79fab28df35440c61c0c4099659077b (patch)
treea12608999c5e7bc2abeab12f8fc1ca35be4c869a
parent71da2f53cf66a66ce5a7e6cb21fc6bc8f9bcb1db (diff)
nvmutil: disable arc4random on obsd below 2.1
arc4random added in openbsd 2,1 Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--util/nvmutil/nvmutil.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 85326d5d..0df6ce89 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -987,7 +987,8 @@ hextonum(char ch_s)
unsigned long
rlong(void)
{
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || \
+#if (defined(__OpenBSD__) && (OpenBSD) >= 201) || \
+ defined(__FreeBSD__) || \
defined(__NetBSD__) || defined(__APPLE__)
unsigned long rval;
@@ -1003,9 +1004,7 @@ rlong(void)
fd = open("/dev/urandom", O_RDONLY | O_BINARY);
-#if !(defined(__OpenBSD__) && defined(OpenBSD)) || \
- (defined(__OpenBSD__) && defined(OpenBSD) && \
- OpenBSD < 604)
+#ifdef __OpenBSD__
if (fd < 0) /* old openbsd */
fd = open("/dev/arandom", O_RDONLY | O_BINARY);
#endif