From 9c4063f39306c3b321b3f0539ebe1bda2cdf070f Mon Sep 17 00:00:00 2001
From: Ben Adida <ben@adida.net>
Date: Thu, 22 Dec 2011 19:18:14 -0800
Subject: [PATCH] mix in the server seed into the client entropy pool, fixes
 #298

---
 resources/static/shared/network.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/resources/static/shared/network.js b/resources/static/shared/network.js
index 847f487a9..98d894b4e 100644
--- a/resources/static/shared/network.js
+++ b/resources/static/shared/network.js
@@ -132,6 +132,11 @@ BrowserID.Network = (function() {
           // XXX remove the ABC123
           code_version = result.code_version || "ABC123";
 
+          // seed the PRNG
+          // FIXME: properly abstract this out, probably by exposing a jwcrypto
+          // interface for randomness
+          require("./libs/all").sjcl.random.addEntropy(result.random_seed);
+
           _.defer(cb);
         },
         error: deferResponse(xhrError(onFailure, {
-- 
GitLab