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