1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[PM-23386] Fix fix usages of encrypt service (#15476)

* Fix incorrect usages of encrypt service

* Add docs

* Fix types
This commit is contained in:
Bernd Schoolmann
2025-07-15 11:56:19 +02:00
committed by GitHub
parent 8250e40c6c
commit d1f0c40e2f
3 changed files with 26 additions and 6 deletions

View File

@@ -74,11 +74,9 @@ export class BitwardenJsonImporter extends BaseImporter implements Importer {
keyForDecryption = await this.keyService.getUserKey();
}
const encKeyValidation = new EncString(results.encKeyValidation_DO_NOT_EDIT);
const encKeyValidationDecrypt = await this.encryptService.decryptString(
encKeyValidation,
keyForDecryption,
);
if (encKeyValidationDecrypt === null) {
try {
await this.encryptService.decryptString(encKeyValidation, keyForDecryption);
} catch {
this.result.success = false;
this.result.errorMessage = this.i18nService.t("importEncKeyError");
return;