mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 01:03:35 +00:00
update pin key when the user symmetric key is set
- always set the protected pin so we can recreate pin key from user symmetric key - stop using EncryptionPair in account - use EncString for both pin key storage - update migration from old strategy on lock component
This commit is contained in:
@@ -9,16 +9,12 @@ describe("AccountSettings", () => {
|
||||
|
||||
it("should deserialize userSymKeyPin", () => {
|
||||
const accountSettings = new AccountSettings();
|
||||
accountSettings.userSymKeyPin = EncryptionPair.fromJSON<string, EncString>({
|
||||
encrypted: "encrypted",
|
||||
decrypted: "3.data",
|
||||
});
|
||||
accountSettings.userSymKeyPin = EncString.fromJSON("encrypted");
|
||||
const jsonObj = JSON.parse(JSON.stringify(accountSettings));
|
||||
const actual = AccountSettings.fromJSON(jsonObj);
|
||||
|
||||
expect(actual.userSymKeyPin).toBeInstanceOf(EncryptionPair);
|
||||
expect(actual.userSymKeyPin.encrypted).toEqual("encrypted");
|
||||
expect(actual.userSymKeyPin.decrypted.encryptedString).toEqual("3.data");
|
||||
expect(actual.userSymKeyPin).toBeInstanceOf(EncString);
|
||||
expect(actual.userSymKeyPin.encryptedString).toEqual("encrypted");
|
||||
});
|
||||
|
||||
it("should deserialize pinProtected", () => {
|
||||
|
||||
Reference in New Issue
Block a user