Use BoringSSL to get random bytes
Bug: 117508900
Change-Id: I4889513c0671ff2b689f1beca8084d6f149d473d
Test: Existing tests pass
diff --git a/src/crypto/random.c b/src/crypto/random.c
index c278d9c..6f4cf81 100644
--- a/src/crypto/random.c
+++ b/src/crypto/random.c
@@ -162,10 +162,17 @@
wpa_printf(MSG_MSGDUMP, "Get randomness: len=%u entropy=%u",
(unsigned int) len, entropy);
+#ifdef CONFIG_USE_OPENSSL_RNG
+ /* Start with assumed strong randomness from OpenSSL */
+ ret = crypto_get_random(buf, len);
+ wpa_hexdump_key(MSG_EXCESSIVE, "random from crypto_get_random",
+ buf, len);
+#else /* CONFIG_USE_OPENSSL_RNG */
/* Start with assumed strong randomness from OS */
ret = os_get_random(buf, len);
wpa_hexdump_key(MSG_EXCESSIVE, "random from os_get_random",
buf, len);
+#endif /* CONFIG_USE_OPENSSL_RNG */
/* Mix in additional entropy extracted from the internal pool */
left = len;