mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
Import Tycho weave client
This commit is contained in:
parent
e4ac0e17f8
commit
c53787dfdb
183 changed files with 7272 additions and 16759 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue