mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
[PM-21001] Move tools usage of encrypt service (#14540)
* Add new encrypt service functions * Undo changes * Cleanup * Fix build * Fix comments * Move tools usage of encrypt service
This commit is contained in:
@@ -72,7 +72,7 @@ export class BitwardenJsonImporter extends BaseImporter implements Importer {
|
||||
keyForDecryption = await this.keyService.getUserKeyWithLegacySupport();
|
||||
}
|
||||
const encKeyValidation = new EncString(results.encKeyValidation_DO_NOT_EDIT);
|
||||
const encKeyValidationDecrypt = await this.encryptService.decryptToUtf8(
|
||||
const encKeyValidationDecrypt = await this.encryptService.decryptString(
|
||||
encKeyValidation,
|
||||
keyForDecryption,
|
||||
);
|
||||
|
||||
@@ -92,7 +92,7 @@ describe("BitwardenPasswordProtectedImporter", () => {
|
||||
});
|
||||
|
||||
it("succeeds with default jdoc", async () => {
|
||||
encryptService.decryptToUtf8.mockReturnValue(Promise.resolve(emptyUnencryptedExport));
|
||||
encryptService.decryptString.mockReturnValue(Promise.resolve(emptyUnencryptedExport));
|
||||
|
||||
expect((await importer.parse(JSON.stringify(jDoc))).success).toEqual(true);
|
||||
});
|
||||
|
||||
@@ -69,7 +69,7 @@ export class BitwardenPasswordProtectedImporter extends BitwardenJsonImporter im
|
||||
}
|
||||
|
||||
const encData = new EncString(parsedData.data);
|
||||
const clearTextData = await this.encryptService.decryptToUtf8(encData, this.key);
|
||||
const clearTextData = await this.encryptService.decryptString(encData, this.key);
|
||||
return await super.parse(clearTextData);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export class BitwardenPasswordProtectedImporter extends BitwardenJsonImporter im
|
||||
|
||||
const encKeyValidation = new EncString(jdoc.encKeyValidation_DO_NOT_EDIT);
|
||||
|
||||
const encKeyValidationDecrypt = await this.encryptService.decryptToUtf8(
|
||||
const encKeyValidationDecrypt = await this.encryptService.decryptString(
|
||||
encKeyValidation,
|
||||
this.key,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user