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:
committed by
CQ bot account: commit-bot@chromium.org
parent
9747a53284
commit
e39d136568
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user