1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-23 11:43:46 +00:00

[PS-2251] Implement argon2 kdf (#4468)

* Implement argon2

* Remove argon2 webassembly warning

* Replace magic numbers by enum

* move packages

* cleanup call to argon2

* update call to node argon2

* don't need  wasm-eval

* revert config changes

* Update libs/common/src/enums/kdfType.ts

Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>

* Update kdfType.ts

* apply DEFAULT_PBKDF2_ITERATIONS

* checkIfWasmSupported

Co-authored-by: Kyle Spearrin <kyle.spearrin@gmail.com>
Co-authored-by: Kyle Spearrin <kspearrin@users.noreply.github.com>
Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
This commit is contained in:
Bernd Schoolmann
2023-01-26 15:20:12 +01:00
committed by GitHub
parent d02af23b30
commit e055e68991
18 changed files with 343 additions and 107 deletions

View File

@@ -10,7 +10,7 @@ import {
} from "../abstractions/export.service";
import { FolderService } from "../abstractions/folder/folder.service.abstraction";
import { CipherType } from "../enums/cipherType";
import { DEFAULT_KDF_ITERATIONS, KdfType } from "../enums/kdfType";
import { DEFAULT_PBKDF2_ITERATIONS, KdfType } from "../enums/kdfType";
import { Utils } from "../misc/utils";
import { CipherData } from "../models/data/cipher.data";
import { CollectionData } from "../models/data/collection.data";
@@ -54,7 +54,7 @@ export class ExportService implements ExportServiceAbstraction {
: await this.getExport("json");
const salt = Utils.fromBufferToB64(await this.cryptoFunctionService.randomBytes(16));
const kdfIterations = DEFAULT_KDF_ITERATIONS;
const kdfIterations = DEFAULT_PBKDF2_ITERATIONS;
const key = await this.cryptoService.makePinKey(
password,
salt,