Move to preferring getentropy() for system provided entropy This changes the order of things so that by default your system is expected to provide us with a getentropy() in <unistd.h> for integrators that are not explicitly supported. We preserve the getrandom/urandom dance for Linux and Android for now. Linux has had getentropy() in libc's since 2017 macOS, and all the BSD's have had it for any versions we care about. iOS hides it from us - so we use CommonCrypto CCRandomGenerateBytes Update-Note: Non-macOS Apple platforms now use CCRandomGenerateBytes instead of /dev/urandom. Linux behavior remains unchanged. Platforms which were not explicitly supported with a different codepath will also switch from /dev/urandom to getentropy. If your platform specifically requires /dev/urandom, let us know.know Bug: 287 Change-Id: I0c2b8c594c473e4395379f50b0c4e6713c0a4c02 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/61325 Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: Bob Beck <bbe@google.com>
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 7bc73b1..7c944c1 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt
@@ -200,6 +200,8 @@ rand_extra/deterministic.c rand_extra/forkunsafe.c rand_extra/fuchsia.c + rand_extra/getentropy.c + rand_extra/ios.c rand_extra/passive.c rand_extra/rand_extra.c rand_extra/windows.c