mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-03-25 13:29:03 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user