1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

makeKeyFromPin in background context

This commit is contained in:
Kyle Spearrin
2019-03-05 16:36:11 -05:00
parent 39f3a0788d
commit cc27f98aae
3 changed files with 15 additions and 5 deletions

View File

@@ -66,12 +66,9 @@ export class LockComponent implements OnInit {
this.doContinue();
}
} else {
const pinProtectedKey = await this.storageService.get<string>(ConstantsService.pinProtectedKey);
const protectedKeyCs = new CipherString(pinProtectedKey);
const pinKey = await this.cryptoService.makePinKey(this.pin, this.email, kdf, kdfIterations);
const decKey = await this.cryptoService.decryptToBytes(protectedKeyCs, pinKey);
const key = await this.cryptoService.makeKeyFromPin(this.pin, this.email, kdf, kdfIterations);
failed = false;
await this.setKeyAndContinue(new SymmetricCryptoKey(decKey));
await this.setKeyAndContinue(key);
}
} catch {
failed = true;