mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 400751 Migrating from an existing SeaMonkey installation causes errors in password manager due to old style encyption. r=dolske,gavin,aM9=beltzner
This commit is contained in:
parent
8853d43cd5
commit
0152d4c715
@ -154,7 +154,7 @@ LoginManagerStorage_legacy.prototype = {
|
||||
}
|
||||
|
||||
// Read in the stored login data.
|
||||
this._readFile()
|
||||
this._readFile();
|
||||
|
||||
// If we were importing, write back to the normal file.
|
||||
if (importFile) {
|
||||
@ -810,14 +810,28 @@ LoginManagerStorage_legacy.prototype = {
|
||||
login.username = username;
|
||||
login.password = password;
|
||||
|
||||
// Force any old mime64-obscured entries to be reencrypted.
|
||||
// Old mime64-obscured entries need to be reencrypted in the new
|
||||
// format.
|
||||
if (login.wrappedJSObject.encryptedUsername &&
|
||||
login.wrappedJSObject.encryptedUsername.charAt(0) == '~')
|
||||
login.wrappedJSObject.encryptedUsername = null;
|
||||
login.wrappedJSObject.encryptedUsername.charAt(0) == '~') {
|
||||
[username, userCanceled] = this._encrypt(login.username);
|
||||
|
||||
if (userCanceled)
|
||||
break;
|
||||
|
||||
login.wrappedJSObject.encryptedUsername = username;
|
||||
}
|
||||
|
||||
if (login.wrappedJSObject.encryptedPassword &&
|
||||
login.wrappedJSObject.encryptedPassword.charAt(0) == '~')
|
||||
login.wrappedJSObject.encryptedPassword = null;
|
||||
login.wrappedJSObject.encryptedPassword.charAt(0) == '~') {
|
||||
|
||||
[password, userCanceled] = this._encrypt(login.password);
|
||||
|
||||
if (userCanceled)
|
||||
break;
|
||||
|
||||
login.wrappedJSObject.encryptedPassword = password;
|
||||
}
|
||||
|
||||
result.push(login);
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ LoginTest.checkStorageData(storage, ["http://www.disabled.com"], []);
|
||||
|
||||
/* ========== 7 ========== */
|
||||
testnum++;
|
||||
testdesc = "Initialize with signons-06.txt (1 disabled, 0 logins, extra '.')";
|
||||
testdesc = "Initialize with signons-04.txt (1 disabled, 0 logins, extra '.')";
|
||||
|
||||
// Mozilla code should never have generated the extra ".", but it's possible
|
||||
// someone writing an external utility might have generated it, since it
|
||||
|
@ -146,6 +146,38 @@ logins = storage.getAllLogins({});
|
||||
LoginTest.checkStorageData(storage, [], [dummyuser4]);
|
||||
|
||||
|
||||
/*
|
||||
* ---------------------- Bug 400751 ----------------------
|
||||
* Migrating from existing mime64 encoded format causes
|
||||
* errors in storage legacy's code
|
||||
*/
|
||||
|
||||
|
||||
/* ========== 8 ========== */
|
||||
testnum++;
|
||||
|
||||
testdesc = "checking double reading of mime64-obscured entries";
|
||||
LoginTest.initStorage(storage, INDIR, "signons-380961-1.txt");
|
||||
LoginTest.checkStorageData(storage, [], [dummyuser1]);
|
||||
|
||||
testdesc = "checking double reading of mime64-obscured entries part 2";
|
||||
LoginTest.checkStorageData(storage, [], [dummyuser1]);
|
||||
|
||||
/* ========== 9 ========== */
|
||||
testnum++;
|
||||
|
||||
testdesc = "checking correct storage of mime64 converted entries";
|
||||
LoginTest.initStorage(storage, INDIR, "signons-380961-1.txt",
|
||||
OUTDIR, "output-400751-1.txt");
|
||||
LoginTest.checkStorageData(storage, [], [dummyuser1]);
|
||||
LoginTest.checkStorageData(storage, [], [dummyuser1]);
|
||||
storage.addLogin(dummyuser2); // trigger a write
|
||||
LoginTest.checkStorageData(storage, [], [dummyuser1, dummyuser2]);
|
||||
|
||||
testdesc = "[flush and reload for verification]";
|
||||
LoginTest.initStorage(storage, OUTDIR, "output-400751-1.txt");
|
||||
LoginTest.checkStorageData(storage, [], [dummyuser1, dummyuser2]);
|
||||
|
||||
} catch (e) {
|
||||
throw ("FAILED in test #" + testnum + " -- " + testdesc + ": " + e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user