From: Andrew Deason Date: Wed, 7 Mar 2018 21:57:56 +0000 (-0600) Subject: hcrypto: Avoid arc4random in kernel X-Git-Tag: upstream/1.8.1_pre2^2~60 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=04ed8a2f4fb33c22b1e6c0a56f137666e412a64d;p=packages%2Fo%2Fopenafs.git hcrypto: Avoid arc4random in kernel Our HAVE_ARC4RANDOM symbol represents the availability of arc4random() in userspace, not in the kernel. On Solaris, we'll define HAVE_ARC4RANDOM, but the built kernel module will be unusable, since we cannot resolve the arc4random symbol. To to avoid this, undef HAVE_ARC4RANDOM when building hcrypto for the kernel, just like we do with HAVE_GETUID. Reviewed-on: https://gerrit.openafs.org/12946 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 6082243e42525c738239fe429bcb64e0e4f22207) Change-Id: I41c4c6f65581aee3d53a7c4b8f6c108f88631e3f Reviewed-on: https://gerrit.openafs.org/13101 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- diff --git a/src/crypto/hcrypto/kernel/config.h b/src/crypto/hcrypto/kernel/config.h index b6104348b..6fec83da0 100644 --- a/src/crypto/hcrypto/kernel/config.h +++ b/src/crypto/hcrypto/kernel/config.h @@ -95,6 +95,9 @@ static_inline int close(int d) {return -1;} #if defined(HAVE_GETUID) #undef HAVE_GETUID #endif +#ifdef HAVE_ARC4RANDOM +# undef HAVE_ARC4RANDOM +#endif static_inline int gettimeofday(struct timeval *tp, void *tzp) {if (tp == NULL) return -1; tp->tv_sec = osi_Time(); tp->tv_usec = 0; return 0;}