From: Ken Hornstein Date: Fri, 29 Nov 2024 21:32:06 +0000 (-0500) Subject: Check for sys/random.h X-Git-Tag: krb5-1.22-beta1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b43f4229758ff8e78897e03c386025cf4de3a200;p=thirdparty%2Fkrb5.git Check for sys/random.h 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 --- diff --git a/src/configure.ac b/src/configure.ac index 10a5d1a741..9d4e08a708 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -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++) diff --git a/src/lib/crypto/krb/prng.c b/src/lib/crypto/krb/prng.c index a9c1668157..4a6464558c 100644 --- a/src/lib/crypto/krb/prng.c +++ b/src/lib/crypto/krb/prng.c @@ -56,6 +56,9 @@ get_os_entropy(unsigned char *buf, size_t len) #ifdef HAVE_SYS_STAT_H #include #endif +#ifdef HAVE_SYS_RANDOM_H +#include +#endif #ifdef __linux__ #include #endif /* __linux__ */