mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-27 12:36:14 +01:00
enable key stretching on makeEncKey
This commit is contained in:
parent
6f43b73237
commit
1454aff46c
@ -319,9 +319,6 @@ export class CryptoService implements CryptoServiceAbstraction {
|
|||||||
async makeEncKey(key: SymmetricCryptoKey): Promise<[SymmetricCryptoKey, CipherString]> {
|
async makeEncKey(key: SymmetricCryptoKey): Promise<[SymmetricCryptoKey, CipherString]> {
|
||||||
const encKey = await this.cryptoFunctionService.randomBytes(64);
|
const encKey = await this.cryptoFunctionService.randomBytes(64);
|
||||||
let encKeyEnc: CipherString = null;
|
let encKeyEnc: CipherString = null;
|
||||||
// TODO: Uncomment when we're ready to enable key stretching
|
|
||||||
encKeyEnc = await this.encrypt(encKey, key);
|
|
||||||
/*
|
|
||||||
if (key.key.byteLength === 32) {
|
if (key.key.byteLength === 32) {
|
||||||
const newKey = await this.stretchKey(key);
|
const newKey = await this.stretchKey(key);
|
||||||
encKeyEnc = await this.encrypt(encKey, newKey);
|
encKeyEnc = await this.encrypt(encKey, newKey);
|
||||||
@ -330,7 +327,6 @@ export class CryptoService implements CryptoServiceAbstraction {
|
|||||||
} else {
|
} else {
|
||||||
throw new Error('Invalid key size.');
|
throw new Error('Invalid key size.');
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
return [new SymmetricCryptoKey(encKey), encKeyEnc];
|
return [new SymmetricCryptoKey(encKey), encKeyEnc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user