Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: content/zygote/zygote_main_linux.cc

Issue 401153002: Switch to BoringSSL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase across DEPS change Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_child.gypi ('k') | crypto/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/zygote/zygote_main_linux.cc
diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
index 60f08b6ad636760ee03bb8d26df13e9075b109a1..5e3746be9bbcd1f5df539175fee25606619296e2 100644
--- a/content/zygote/zygote_main_linux.cc
+++ b/content/zygote/zygote_main_linux.cc
@@ -47,6 +47,10 @@
#include <sys/prctl.h>
#endif
+#if defined(USE_OPENSSL)
+#include <openssl/rand.h>
+#endif
+
#if defined(ENABLE_WEBRTC)
#include "third_party/libjingle/overrides/init_webrtc.h"
#endif
@@ -312,9 +316,10 @@ static void ZygotePreSandboxInit() {
// successful initialization of NSS which tries to load extra library files.
crypto::LoadNSSLibraries();
#elif defined(USE_OPENSSL)
- // OpenSSL is intentionally not supported in the sandboxed processes, see
- // http://crbug.com/99163. If that ever changes we'll likely need to init
- // OpenSSL here (at least, load the library and error strings).
+ // Read a random byte in order to cause BoringSSL to open a file descriptor
+ // for /dev/urandom.
+ uint8_t scratch;
+ RAND_bytes(&scratch, 1);
#else
// It's possible that another hypothetical crypto stack would not require
// pre-sandbox init, but more likely this is just a build configuration error.
« no previous file with comments | « content/content_child.gypi ('k') | crypto/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698