Change configure checks from arc4random to arc4random_buf since this is what is actua...
authorZoltan Varga <vargaz@gmail.com>
Thu, 20 Dec 2018 01:46:55 +0000 (20:46 -0500)
committerStephen Toub <stoub@microsoft.com>
Thu, 20 Dec 2018 01:46:55 +0000 (20:46 -0500)
Commit migrated from https://github.com/dotnet/corefx/commit/8a05b3f5f3947341e1867210a791a5c8a617cde6

src/libraries/Native/Unix/Common/pal_config.h.in
src/libraries/Native/Unix/System.Native/pal_random.c
src/libraries/Native/Unix/configure.cmake

index 372296a..d372ed8 100644 (file)
@@ -32,7 +32,7 @@
 #cmakedefine01 HAVE_TIOCGWINSZ
 #cmakedefine01 HAVE_SCHED_GETAFFINITY
 #cmakedefine01 HAVE_SCHED_SETAFFINITY
-#cmakedefine01 HAVE_ARC4RANDOM
+#cmakedefine01 HAVE_ARC4RANDOM_BUF
 #cmakedefine01 KEVENT_HAS_VOID_UDATA
 #cmakedefine01 HAVE_FDS_BITS
 #cmakedefine01 HAVE_PRIVATE_FDS_BITS
index 979df55..8a267a3 100644 (file)
@@ -24,7 +24,7 @@ void SystemNative_GetNonCryptographicallySecureRandomBytes(uint8_t* buffer, int3
 {
     assert(buffer != NULL);
 
-#if HAVE_ARC4RANDOM
+#if HAVE_ARC4RANDOM_BUF
     arc4random_buf(buffer, (size_t)bufferLength);
 #else
     static volatile int rand_des = -1;
@@ -105,5 +105,5 @@ void SystemNative_GetNonCryptographicallySecureRandomBytes(uint8_t* buffer, int3
         *(buffer + i) ^= num;
         num >>= 8;
     }
-#endif // HAVE_ARC4RANDOM
+#endif // HAVE_ARC4RANDOM_BUF
 }
index e3c2469..a76aef0 100644 (file)
@@ -156,9 +156,9 @@ check_symbol_exists(
     HAVE_SCHED_SETAFFINITY)
 
 check_symbol_exists(
-    arc4random
+    arc4random_buf
     "stdlib.h"
-    HAVE_ARC4RANDOM)
+    HAVE_ARC4RANDOM_BUF)
 
 check_symbol_exists(
     TIOCGWINSZ