]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Check for sys/random.h 1397/head
authorKen Hornstein <kenh@cmf.nrl.navy.mil>
Fri, 29 Nov 2024 21:32:06 +0000 (16:32 -0500)
committerGreg Hudson <ghudson@mit.edu>
Mon, 2 Dec 2024 18:21:06 +0000 (13:21 -0500)
The function getentropy() is supported on newer versions of MacOS X,
but requires the include file sys/random.h.  Check for that and include
it where getentropy() is used.

ticket: 9149

src/configure.ac
src/lib/crypto/krb/prng.c

index 10a5d1a74188aa1fff507002eb7fa12efc836eda..9d4e08a7081e35d14c8387a72a8576ddb159842e 100644 (file)
@@ -490,7 +490,7 @@ AC_SUBST(GETTIMEOFDAY_ST_OBJ)
 AC_SUBST(EXTRA_SUPPORT_SYMS)
 
 DECLARE_SYS_ERRLIST
-AC_CHECK_HEADERS(unistd.h paths.h regex.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h byteswap.h machine/endian.h machine/byte_order.h sys/bswap.h endian.h pwd.h arpa/inet.h alloca.h dlfcn.h limits.h)
+AC_CHECK_HEADERS(unistd.h paths.h regex.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h byteswap.h machine/endian.h machine/byte_order.h sys/bswap.h endian.h pwd.h arpa/inet.h alloca.h dlfcn.h limits.h sys/random.h)
 AC_CHECK_HEADER(regexp.h, [], [],
 [#define INIT char *sp = instring;
 #define GETC() (*sp++)
index a9c1668157543f80d9a17d9149fd96058f9e6a1d..4a6464558c144af7c069e8e40443695112239ddf 100644 (file)
@@ -56,6 +56,9 @@ get_os_entropy(unsigned char *buf, size_t len)
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
+#ifdef HAVE_SYS_RANDOM_H
+#include <sys/random.h>
+#endif
 #ifdef __linux__
 #include <sys/syscall.h>
 #endif /* __linux__ */