use user kdf settings for making PIN key

This commit is contained in:
Kyle Spearrin 2019-02-13 00:04:34 -05:00
parent d5cbae7803
commit f4a7e7591d
2 changed files with 5 additions and 2 deletions

2
jslib

@ -1 +1 @@
Subproject commit 7a1e7b54743f065ee10eb27499186b629cce22b5 Subproject commit 53260a5be8456f5d45fe68dfcac59dc28ab4e8c2

View File

@ -122,7 +122,10 @@ export class SettingsComponent implements OnInit {
buttons: [this.i18nService.t('cancel'), this.i18nService.t('submit')], buttons: [this.i18nService.t('cancel'), this.i18nService.t('submit')],
}); });
if (pin != null && pin.trim() !== '') { if (pin != null && pin.trim() !== '') {
const pinKey = await this.cryptoService.makePinKey(pin, await this.userService.getEmail()); const kdf = await this.userService.getKdf();
const kdfIterations = await this.userService.getKdfIterations();
const email = await this.userService.getEmail();
const pinKey = await this.cryptoService.makePinKey(pin, email, kdf, kdfIterations);
const key = await this.cryptoService.getKey(); const key = await this.cryptoService.getKey();
const pinProtectedKey = await this.cryptoService.encrypt(key.key, pinKey); const pinProtectedKey = await this.cryptoService.encrypt(key.key, pinKey);
await this.storageService.save(ConstantsService.pinProtectedKey, pinProtectedKey.encryptedString); await this.storageService.save(ConstantsService.pinProtectedKey, pinProtectedKey.encryptedString);