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

fix unreachable code

This commit is contained in:
Kyle Spearrin 2018-06-13 17:06:09 -04:00
parent 0429c0557b
commit 6aa922f380

View File

@ -268,15 +268,18 @@ export class CryptoService implements CryptoServiceAbstraction {
async makeEncKey(key: SymmetricCryptoKey): Promise<CipherString> {
const encKey = await this.cryptoFunctionService.randomBytes(64);
// TODO: remove false/true flags when we're ready to enable key stretching
if (false && key.key.byteLength === 32) {
// TODO: Uncomment when we're ready to enable key stretching
return this.encrypt(encKey, key);
/*
if (key.key.byteLength === 32) {
const newKey = await this.stretchKey(key);
return this.encrypt(encKey, newKey);
} else if (true || key.key.byteLength === 64) {
} else if (key.key.byteLength === 64) {
return this.encrypt(encKey, key);
} else {
throw new Error('Invalid key size.');
}
*/
}
async stretchKey(key: SymmetricCryptoKey): Promise<SymmetricCryptoKey> {