1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-10 21:50:15 +00:00

Fix min and default values in kdf migration

This commit is contained in:
Bernd Schoolmann
2025-11-03 15:15:38 +01:00
parent 60be9a2e1f
commit a456e7e330
2 changed files with 2 additions and 2 deletions

View File

@@ -140,7 +140,7 @@ describe("MinimumKdfMigration", () => {
// Verify the PBKDF2KdfConfig has the correct iteration count
const kdfConfigArg = (mockChangeKdfService.updateUserKdfParams as jest.Mock).mock.calls[0][1];
expect(kdfConfigArg.iterations).toBe(PBKDF2KdfConfig.ITERATIONS.min);
expect(kdfConfigArg.iterations).toBe(PBKDF2KdfConfig.ITERATIONS.defaultValue);
});
it("should throw error when userId is null", async () => {

View File

@@ -54,7 +54,7 @@ export class MinimumKdfMigration implements EncryptedMigration {
const kdfConfig = await this.kdfConfigService.getKdfConfig(userId);
if (
kdfConfig.kdfType !== KdfType.PBKDF2_SHA256 ||
kdfConfig.iterations >= PBKDF2KdfConfig.ITERATIONS.defaultValue
kdfConfig.iterations >= PBKDF2KdfConfig.ITERATIONS.min
) {
return "noMigrationNeeded";
}