src: fix v8 PRNG entropy seeding
authorBen Noordhuis <info@bnoordhuis.nl>
Mon, 23 Sep 2013 12:27:26 +0000 (14:27 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Mon, 23 Sep 2013 12:27:35 +0000 (14:27 +0200)
It was pointed out by a member of the V8 team that the call to
V8::SetEntropySource() should come before V8::Initialize().

See also commit 7ac2391.

src/node.cc

index 0f630c5..b736872 100644 (file)
@@ -3223,13 +3223,13 @@ int Start(int argc, char** argv) {
   const char** exec_argv;
   Init(&argc, const_cast<const char**>(argv), &exec_argc, &exec_argv);
 
-  V8::Initialize();
 #if HAVE_OPENSSL
   // V8 on Windows doesn't have a good source of entropy. Seed it from
   // OpenSSL's pool.
   V8::SetEntropySource(crypto::EntropySource);
 #endif
 
+  V8::Initialize();
   {
     Locker locker(node_isolate);
     Environment* env =