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.
This commit is contained in:
Ventero 2014-04-17 15:56:50 +02:00
parent cf79b41cc4
commit 3d7db4dbc3

View file

@ -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() {