mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Fix exception in options.js on first run
Fixes #22 Uncaught ReferenceError: getRandomBytes is not defined options.js:41
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
var crypto_tests = {};
|
||||
|
||||
window.crypto = (function() {
|
||||
function getRandomBytes(size) {
|
||||
crypto.getRandomBytes = function(size) {
|
||||
//TODO: Better random (https://www.grc.com/r&d/js.htm?)
|
||||
try {
|
||||
var buffer = new ArrayBuffer(size);
|
||||
@@ -60,7 +60,7 @@ window.crypto = (function() {
|
||||
var privToPub = function(privKey, isIdentity) { return crypto_tests.privToPub(privKey, isIdentity); }
|
||||
|
||||
crypto_tests.createNewKeyPair = function(isIdentity) {
|
||||
return privToPub(getRandomBytes(32), isIdentity);
|
||||
return privToPub(crypto.getRandomBytes(32), isIdentity);
|
||||
}
|
||||
var createNewKeyPair = function(isIdentity) { return crypto_tests.createNewKeyPair(isIdentity); }
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ $('#number').on('change', function() {//TODO
|
||||
});
|
||||
|
||||
var single_device = false;
|
||||
var signaling_key = getRandomBytes(32 + 20);
|
||||
var password = btoa(getString(getRandomBytes(16)));
|
||||
var signaling_key = window.crypto.getRandomBytes(32 + 20);
|
||||
var password = btoa(getString(window.crypto.getRandomBytes(16)));
|
||||
password = password.substring(0, password.length - 2);
|
||||
|
||||
$('#init-go-single-client').click(function() {
|
||||
|
||||
Reference in New Issue
Block a user