mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 13:13:49 +01:00
rand: remove getentropy() fallback for macOS < 10.12
This commit is contained in:
@@ -315,13 +315,10 @@ void GetOSRand(unsigned char *ent32)
|
|||||||
RandFailure();
|
RandFailure();
|
||||||
}
|
}
|
||||||
#elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)
|
#elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)
|
||||||
// We need a fallback for OSX < 10.12
|
/* getentropy() is available on macOS 10.12 and later.
|
||||||
if (&getentropy != nullptr) {
|
*/
|
||||||
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
|
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
|
||||||
RandFailure();
|
RandFailure();
|
||||||
}
|
|
||||||
} else {
|
|
||||||
GetDevURandom(ent32);
|
|
||||||
}
|
}
|
||||||
#elif defined(HAVE_SYSCTL_ARND)
|
#elif defined(HAVE_SYSCTL_ARND)
|
||||||
/* FreeBSD and similar. It is possible for the call to return less
|
/* FreeBSD and similar. It is possible for the call to return less
|
||||||
|
|||||||
Reference in New Issue
Block a user