1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-08 09:43:42 +01:00

enable key stretching on makeEncKey

This commit is contained in:
Kyle Spearrin 2018-08-27 16:47:19 -04:00
parent 6f43b73237
commit 1454aff46c

View File

@ -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];
} }