nvmutil: disable arc4random on obsd below 2.1

arc4random added in openbsd 2,1

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-18 05:18:23 +00:00
parent b60a243a87
commit 411076b499
+3 -4
View File
@@ -987,7 +987,8 @@ hextonum(char ch_s)
unsigned long unsigned long
rlong(void) rlong(void)
{ {
#if defined(__OpenBSD__) || defined(__FreeBSD__) || \ #if (defined(__OpenBSD__) && (OpenBSD) >= 201) || \
defined(__FreeBSD__) || \
defined(__NetBSD__) || defined(__APPLE__) defined(__NetBSD__) || defined(__APPLE__)
unsigned long rval; unsigned long rval;
@@ -1003,9 +1004,7 @@ rlong(void)
fd = open("/dev/urandom", O_RDONLY | O_BINARY); fd = open("/dev/urandom", O_RDONLY | O_BINARY);
#if !(defined(__OpenBSD__) && defined(OpenBSD)) || \ #ifdef __OpenBSD__
(defined(__OpenBSD__) && defined(OpenBSD) && \
OpenBSD < 604)
if (fd < 0) /* old openbsd */ if (fd < 0) /* old openbsd */
fd = open("/dev/arandom", O_RDONLY | O_BINARY); fd = open("/dev/arandom", O_RDONLY | O_BINARY);
#endif #endif