mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-19 19:23:24 +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
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user