Title: [91510] trunk/Source/WebKit/chromium
Revision
91510
Author
[email protected]
Date
2011-07-21 14:53:12 -0700 (Thu, 21 Jul 2011)

Log Message

2011-07-20  Cris Neckar  <[email protected]>

        Hook v8 up to cryptographicallyRandomValues as an entropy source.
        https://bugs.webkit.org/show_bug.cgi?id=64887

        Reviewed by Adam Barth.

        * src/WebKit.cpp:
        (WebKit::generateEntropy):
        (WebKit::initialize):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (91509 => 91510)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-07-21 21:50:10 UTC (rev 91509)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-07-21 21:53:12 UTC (rev 91510)
@@ -1,3 +1,14 @@
+2011-07-20  Cris Neckar  <[email protected]>
+
+        Hook v8 up to cryptographicallyRandomValues as an entropy source.
+        https://bugs.webkit.org/show_bug.cgi?id=64887
+
+        Reviewed by Adam Barth.
+
+        * src/WebKit.cpp:
+        (WebKit::generateEntropy):
+        (WebKit::initialize):
+
 2011-07-21  Vsevolod Vlasov  <[email protected]>
 
         [Chromium DevTools] Remove unused method setAgentIdentifierPrefix from WebDevToolAgent.

Modified: trunk/Source/WebKit/chromium/src/WebKit.cpp (91509 => 91510)


--- trunk/Source/WebKit/chromium/src/WebKit.cpp	2011-07-21 21:50:10 UTC (rev 91509)
+++ trunk/Source/WebKit/chromium/src/WebKit.cpp	2011-07-21 21:53:12 UTC (rev 91510)
@@ -37,6 +37,7 @@
 #include "Settings.h"
 #include "TextEncoding.h"
 #include "V8Binding.h"
+#include "WebKitClient.h"
 #include "WebMediaPlayerClientImpl.h"
 #include "WebSocket.h"
 #include "WorkerContextExecutionProxy.h"
@@ -55,6 +56,15 @@
 static WebKitClient* s_webKitClient = 0;
 static bool s_layoutTestMode = false;
 
+static bool generateEntropy(unsigned char* buffer, size_t length)
+{
+    if (s_webKitClient) {
+        s_webKitClient->cryptographicallyRandomValues(buffer, length);
+        return true;
+    }
+    return false;
+}
+
 void initialize(WebKitClient* webKitClient)
 {
     ASSERT(!s_webKitInitialized);
@@ -77,6 +87,7 @@
     // this, initializing this lazily probably doesn't buy us much.
     WebCore::UTF8Encoding();
 
+    v8::V8::SetEntropySource(&generateEntropy);
     v8::V8::Initialize();
     WebCore::V8BindingPerIsolateData::ensureInitialized(v8::Isolate::GetCurrent());
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to