Skip to content

Commit

Permalink
rand: remove getentropy() fallback for macOS < 10.12
Browse files Browse the repository at this point in the history
  • Loading branch information
fanquake committed Mar 17, 2020
1 parent 7060d2d commit a889711
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/random.cpp
Expand Up @@ -315,13 +315,10 @@ 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) {
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
RandFailure();
}
} else {
GetDevURandom(ent32);
/* getentropy() is available on macOS 10.12 and later.
*/
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
RandFailure();
}
#elif defined(HAVE_SYSCTL_ARND)
/* FreeBSD and similar. It is possible for the call to return less
Expand Down

0 comments on commit a889711

Please sign in to comment.