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>
diff --git a/crypto/fipsmodule/rand/urandom.c b/crypto/fipsmodule/rand/urandom.c
index 56e4fbd..f63857f 100644
--- a/crypto/fipsmodule/rand/urandom.c
+++ b/crypto/fipsmodule/rand/urandom.c
@@ -183,6 +183,12 @@
   }
 #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);