Skip to content

Commit a889711

Browse files
committed
rand: remove getentropy() fallback for macOS < 10.12
1 parent 7060d2d commit a889711

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/random.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,10 @@ void GetOSRand(unsigned char *ent32)
315315
RandFailure();
316316
}
317317
#elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)
318-
// We need a fallback for OSX < 10.12
319-
if (&getentropy != nullptr) {
320-
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
321-
RandFailure();
322-
}
323-
} else {
324-
GetDevURandom(ent32);
318+
/* getentropy() is available on macOS 10.12 and later.
319+
*/
320+
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
321+
RandFailure();
325322
}
326323
#elif defined(HAVE_SYSCTL_ARND)
327324
/* FreeBSD and similar. It is possible for the call to return less

0 commit comments

Comments
 (0)