Require getrandom in Android FIPS builds.

In order to make the entropy story a little simplier, drop support for
using /dev/urandom from Android FIPS builds.

Change-Id: I4c35618dcae1550142e60a886a8b51ba0df765a3
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/37205
Commit-Queue: David Benjamin <davidben@google.com>
Reviewed-by: David Benjamin <davidben@google.com>
This commit is contained in:
Adam Langley
2019-08-22 14:57:58 +00:00
committed by CQ bot account: commit-bot@chromium.org
parent 9747a53284
commit e39d136568
+6
View File
@@ -183,6 +183,12 @@ static void init_once(void) {
}
#endif // USE_NR_getrandom
// Android FIPS builds must support getrandom.
#if defined(BORINGSSL_FIPS) && defined(OPENSSL_ANDROID)
perror("getrandom not found");
abort();
#endif
if (fd == kUnset) {
do {
fd = open("/dev/urandom", O_RDONLY);