mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
[EC-364] Expose key getters on CryptoService (#3170)
* Move resolveLegacyKey to encryptService for utf8 decryption * Deprecate account.keys.legacyEtmKey Includes migration to tidy up leftover data * Use new IEncrypted interface
This commit is contained in:
@@ -1753,24 +1753,6 @@ export class StateService<
|
||||
);
|
||||
}
|
||||
|
||||
@withPrototype(SymmetricCryptoKey, SymmetricCryptoKey.initFromJson)
|
||||
async getLegacyEtmKey(options?: StorageOptions): Promise<SymmetricCryptoKey> {
|
||||
return (
|
||||
await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskOptions()))
|
||||
)?.keys?.legacyEtmKey;
|
||||
}
|
||||
|
||||
async setLegacyEtmKey(value: SymmetricCryptoKey, options?: StorageOptions): Promise<void> {
|
||||
const account = await this.getAccount(
|
||||
this.reconcileOptions(options, await this.defaultOnDiskOptions())
|
||||
);
|
||||
account.keys.legacyEtmKey = value;
|
||||
await this.saveAccount(
|
||||
account,
|
||||
this.reconcileOptions(options, await this.defaultOnDiskOptions())
|
||||
);
|
||||
}
|
||||
|
||||
async getLocalData(options?: StorageOptions): Promise<any> {
|
||||
return (
|
||||
await this.getAccount(this.reconcileOptions(options, await this.defaultOnDiskLocalOptions()))
|
||||
|
||||
Reference in New Issue
Block a user