1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-20 02:03:39 +00:00

use user kdf settings for making PIN key

This commit is contained in:
Kyle Spearrin
2019-02-13 00:04:31 -05:00
parent 7a1e7b5474
commit 53260a5be8
3 changed files with 28 additions and 31 deletions

View File

@@ -324,8 +324,8 @@ export class CryptoService implements CryptoServiceAbstraction {
return [publicB64, privateEnc];
}
async makePinKey(pin: string, salt: string): Promise<SymmetricCryptoKey> {
const pinKey = await this.makeKey(pin, salt, KdfType.PBKDF2_SHA256, 100000);
async makePinKey(pin: string, salt: string, kdf: KdfType, kdfIterations: number): Promise<SymmetricCryptoKey> {
const pinKey = await this.makeKey(pin, salt, kdf, kdfIterations);
return await this.stretchKey(pinKey);
}