From 3d7db4dbc391f1e16aff5fc9c3ce58018d01b17a Mon Sep 17 00:00:00 2001 From: Ventero Date: Thu, 17 Apr 2014 15:56:50 +0200 Subject: [PATCH] Correctly extract string data for password. btoa expects a string argument, so when passing it the ArrayBuffer object returned by getRandomBytes(), it's converted to a string by calling .toString() on it. This always results in "[object ArrayBuffer]", effectively resulting in a completely non-random password. --- js/options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/options.js b/js/options.js index 381c7cef94..321284456d 100644 --- a/js/options.js +++ b/js/options.js @@ -24,7 +24,7 @@ $('#number').on('change', function() {//TODO var single_device = false; var signaling_key = getRandomBytes(32 + 20); -var password = btoa(getRandomBytes(16)); +var password = btoa(getString(getRandomBytes(16))); password = password.substring(0, password.length - 2); $('#init-go-single-client').click(function() {