1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-25 12:15:18 +01:00

reference correct default kdf config (#9822)

* reference correct default kdf config

* update change kdf references
This commit is contained in:
Jake Fink 2024-06-25 08:57:59 -04:00 committed by GitHub
parent 0add2949c0
commit 1fdfd695e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 16 deletions

View File

@ -30,20 +30,24 @@ export class ChangeKdfComponent implements OnInit {
this.kdfConfig.iterations, this.kdfConfig.iterations,
[ [
Validators.required, Validators.required,
Validators.min(PBKDF2_ITERATIONS.min), Validators.min(PBKDF2KdfConfig.ITERATIONS.min),
Validators.max(PBKDF2_ITERATIONS.max), Validators.max(PBKDF2KdfConfig.ITERATIONS.max),
], ],
], ],
memory: [ memory: [
null as number, null as number,
[Validators.required, Validators.min(ARGON2_MEMORY.min), Validators.max(ARGON2_MEMORY.max)], [
Validators.required,
Validators.min(Argon2KdfConfig.MEMORY.min),
Validators.max(Argon2KdfConfig.MEMORY.max),
],
], ],
parallelism: [ parallelism: [
null as number, null as number,
[ [
Validators.required, Validators.required,
Validators.min(ARGON2_PARALLELISM.min), Validators.min(Argon2KdfConfig.PARALLELISM.min),
Validators.max(ARGON2_PARALLELISM.max), Validators.max(Argon2KdfConfig.PARALLELISM.max),
], ],
], ],
}), }),
@ -91,26 +95,26 @@ export class ChangeKdfComponent implements OnInit {
config = new PBKDF2KdfConfig(); config = new PBKDF2KdfConfig();
validators.iterations = [ validators.iterations = [
Validators.required, Validators.required,
Validators.min(PBKDF2_ITERATIONS.min), Validators.min(PBKDF2KdfConfig.ITERATIONS.min),
Validators.max(PBKDF2_ITERATIONS.max), Validators.max(PBKDF2KdfConfig.ITERATIONS.max),
]; ];
break; break;
case KdfType.Argon2id: case KdfType.Argon2id:
config = new Argon2KdfConfig(); config = new Argon2KdfConfig();
validators.iterations = [ validators.iterations = [
Validators.required, Validators.required,
Validators.min(ARGON2_ITERATIONS.min), Validators.min(Argon2KdfConfig.ITERATIONS.min),
Validators.max(ARGON2_ITERATIONS.max), Validators.max(Argon2KdfConfig.ITERATIONS.max),
]; ];
validators.memory = [ validators.memory = [
Validators.required, Validators.required,
Validators.min(ARGON2_MEMORY.min), Validators.min(Argon2KdfConfig.MEMORY.min),
Validators.max(ARGON2_MEMORY.max), Validators.max(Argon2KdfConfig.MEMORY.max),
]; ];
validators.parallelism = [ validators.parallelism = [
Validators.required, Validators.required,
Validators.min(ARGON2_PARALLELISM.min), Validators.min(Argon2KdfConfig.PARALLELISM.min),
Validators.max(ARGON2_PARALLELISM.max), Validators.max(Argon2KdfConfig.PARALLELISM.max),
]; ];
break; break;
default: default:

View File

@ -6,10 +6,12 @@ import { AuditService } from "@bitwarden/common/abstractions/audit.service";
import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/policy/policy-api.service.abstraction"; import { PolicyApiServiceAbstraction } from "@bitwarden/common/admin-console/abstractions/policy/policy-api.service.abstraction";
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/models/domain/master-password-policy-options"; import { MasterPasswordPolicyOptions } from "@bitwarden/common/admin-console/models/domain/master-password-policy-options";
import { PBKDF2KdfConfig } from "@bitwarden/common/auth/models/domain/kdf-config"; import {
DEFAULT_KDF_CONFIG,
PBKDF2KdfConfig,
} from "@bitwarden/common/auth/models/domain/kdf-config";
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
import { DEFAULT_KDF_CONFIG } from "@bitwarden/common/platform/enums";
import { Utils } from "@bitwarden/common/platform/misc/utils"; import { Utils } from "@bitwarden/common/platform/misc/utils";
import { MasterKey } from "@bitwarden/common/types/key"; import { MasterKey } from "@bitwarden/common/types/key";
import { import {

View File

@ -1,13 +1,13 @@
import { mock } from "jest-mock-extended"; import { mock } from "jest-mock-extended";
import { KdfConfigService } from "@bitwarden/common/auth/abstractions/kdf-config.service"; import { KdfConfigService } from "@bitwarden/common/auth/abstractions/kdf-config.service";
import { DEFAULT_KDF_CONFIG } from "@bitwarden/common/auth/models/domain/kdf-config";
import { FakeMasterPasswordService } from "@bitwarden/common/auth/services/master-password/fake-master-password.service"; import { FakeMasterPasswordService } from "@bitwarden/common/auth/services/master-password/fake-master-password.service";
import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service"; import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service";
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service"; import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
import { KeyGenerationService } from "@bitwarden/common/platform/abstractions/key-generation.service"; import { KeyGenerationService } from "@bitwarden/common/platform/abstractions/key-generation.service";
import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; import { StateService } from "@bitwarden/common/platform/abstractions/state.service";
import { DEFAULT_KDF_CONFIG } from "@bitwarden/common/platform/enums";
import { Utils } from "@bitwarden/common/platform/misc/utils"; import { Utils } from "@bitwarden/common/platform/misc/utils";
import { EncString } from "@bitwarden/common/platform/models/domain/enc-string"; import { EncString } from "@bitwarden/common/platform/models/domain/enc-string";
import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key"; import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key";