summaryrefslogtreecommitdiffstats
path: root/services/sync/modules/jpakeclient.js
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-10-06 07:09:02 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-10-06 07:09:02 +0200
commit18473f1844a8230130e1fc23d7ebf7d33183316f (patch)
tree75d297ab7eac48e14af88e565dc1e19775de9df1 /services/sync/modules/jpakeclient.js
parent0c47c83e1b3b7d95681a43fbb0de0e17b2cd5b25 (diff)
downloadUXP-18473f1844a8230130e1fc23d7ebf7d33183316f.tar
UXP-18473f1844a8230130e1fc23d7ebf7d33183316f.tar.gz
UXP-18473f1844a8230130e1fc23d7ebf7d33183316f.tar.lz
UXP-18473f1844a8230130e1fc23d7ebf7d33183316f.tar.xz
UXP-18473f1844a8230130e1fc23d7ebf7d33183316f.zip
Update sync client for JS changes.
Diffstat (limited to 'services/sync/modules/jpakeclient.js')
-rw-r--r--services/sync/modules/jpakeclient.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/services/sync/modules/jpakeclient.js b/services/sync/modules/jpakeclient.js
index 10f405371..625dc91b6 100644
--- a/services/sync/modules/jpakeclient.js
+++ b/services/sync/modules/jpakeclient.js
@@ -4,7 +4,7 @@
this.EXPORTED_SYMBOLS = ["JPAKEClient", "SendCredentialsController"];
-const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
+var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
Cu.import("resource://gre/modules/Log.jsm");
Cu.import("resource://services-common/rest.js");
@@ -281,8 +281,7 @@ JPAKEClient.prototype = {
let rng = Cc["@mozilla.org/security/random-generator;1"]
.createInstance(Ci.nsIRandomGenerator);
let bytes = rng.generateRandomBytes(JPAKE_LENGTH_CLIENTID / 2);
- this._clientID = [("0" + byte.toString(16)).slice(-2)
- for each (byte in bytes)].join("");
+ this._clientID = bytes.map(byte => ("0" + byte.toString(16)).slice(-2)).join("");
},
_createSecret: function _createSecret() {
@@ -291,8 +290,7 @@ JPAKEClient.prototype = {
let rng = Cc["@mozilla.org/security/random-generator;1"]
.createInstance(Ci.nsIRandomGenerator);
let bytes = rng.generateRandomBytes(JPAKE_LENGTH_SECRET);
- return [key[Math.floor(byte * key.length / 256)]
- for each (byte in bytes)].join("");
+ return bytes.map(byte => key[Math.floor(byte * key.length / 256)]).join("");
},
_newRequest: function _newRequest(uri) {