зеркало из https://github.com/mozilla/pjs.git
Allow login & sync when encryption is off
This commit is contained in:
Родитель
071c1cffe8
Коммит
dcc4181827
|
@ -681,10 +681,14 @@ Engine.prototype = {
|
|||
this._engineId.setTempPassword(symkey);
|
||||
if (!this._engineId.password)
|
||||
throw "Could not generate a symmetric encryption key";
|
||||
|
||||
Crypto.RSAencrypt.async(Crypto, self.cb,
|
||||
this._engineId.password, this._pbeId);
|
||||
let enckey = yield;
|
||||
|
||||
let enckey = this._engineId.password;
|
||||
if ("none" != Utils.prefs.getCharPref("encryption")) {
|
||||
Crypto.RSAencrypt.async(Crypto, self.cb,
|
||||
this._engineId.password, this._pbeId);
|
||||
enckey = yield;
|
||||
}
|
||||
|
||||
if (!enckey)
|
||||
throw "Could not encrypt symmetric encryption key";
|
||||
|
||||
|
|
|
@ -308,21 +308,22 @@ WeaveSvc.prototype = {
|
|||
|
||||
_keyCheck: function WeaveSvc__keyCheck() {
|
||||
let self = yield;
|
||||
|
||||
if ("none" != Utils.prefs.getCharPref("encryption")) {
|
||||
DAV.GET("private/privkey", self.cb);
|
||||
let keyResp = yield;
|
||||
Utils.ensureStatus(keyResp.status,
|
||||
"Could not get private key from server", [[200,300],404]);
|
||||
|
||||
DAV.GET("private/privkey", self.cb);
|
||||
let keyResp = yield;
|
||||
Utils.ensureStatus(keyResp.status,
|
||||
"Could not get private key from server", [[200,300],404]);
|
||||
|
||||
if (keyResp.status != 404) {
|
||||
let id = ID.get('WeaveCryptoID');
|
||||
id.privkey = keyResp.responseText;
|
||||
Crypto.RSAkeydecrypt.async(Crypto, self.cb, id);
|
||||
id.pubkey = yield;
|
||||
|
||||
} else {
|
||||
this._generateKeys.async(this, self.cb);
|
||||
yield;
|
||||
if (keyResp.status != 404) {
|
||||
let id = ID.get('WeaveCryptoID');
|
||||
id.privkey = keyResp.responseText;
|
||||
Crypto.RSAkeydecrypt.async(Crypto, self.cb, id);
|
||||
id.pubkey = yield;
|
||||
} else {
|
||||
this._generateKeys.async(this, self.cb);
|
||||
yield;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче