rand: remove getentropy() fallback for macOS < 10.12

pull/18364/head
fanquake 5 years ago
parent 7060d2d97a
commit a889711562
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

@ -315,14 +315,11 @@ void GetOSRand(unsigned char *ent32)
RandFailure();
}
#elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)
// We need a fallback for OSX < 10.12
if (&getentropy != nullptr) {
/* getentropy() is available on macOS 10.12 and later.
*/
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
RandFailure();
}
} else {
GetDevURandom(ent32);
}
#elif defined(HAVE_SYSCTL_ARND)
/* FreeBSD and similar. It is possible for the call to return less
* bytes than requested, so need to read in a loop.

Loading…
Cancel
Save