From 85c3056223bae5dbc20100f93db65be2fa6bf7d5 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 27 Aug 2018 19:09:26 -0400 Subject: [PATCH] remakeEncKey when changing password/email --- jslib | 2 +- src/app/settings/change-email.component.ts | 5 ++--- src/app/settings/change-password.component.ts | 5 ++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/jslib b/jslib index 6f43b73237..00562d083b 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 6f43b73237fc64394441d5821bd88090b26cbe5b +Subproject commit 00562d083b687fb566b09c0df8a05e90b86f9e5a diff --git a/src/app/settings/change-email.component.ts b/src/app/settings/change-email.component.ts index 889c05a395..ba6926a675 100644 --- a/src/app/settings/change-email.component.ts +++ b/src/app/settings/change-email.component.ts @@ -57,9 +57,8 @@ export class ChangeEmailComponent { const kdfIterations = await this.userService.getKdfIterations(); const newKey = await this.cryptoService.makeKey(this.masterPassword, this.newEmail, kdf, kdfIterations); request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.masterPassword, newKey); - const encKey = await this.cryptoService.getEncKey(); - const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey); - request.key = newEncKey.encryptedString; + const newEncKey = await this.cryptoService.remakeEncKey(newKey); + request.key = newEncKey[1].encryptedString; try { this.formPromise = this.apiService.postEmail(request); await this.formPromise; diff --git a/src/app/settings/change-password.component.ts b/src/app/settings/change-password.component.ts index d6209978fd..75f76ea236 100644 --- a/src/app/settings/change-password.component.ts +++ b/src/app/settings/change-password.component.ts @@ -58,9 +58,8 @@ export class ChangePasswordComponent { const kdfIterations = await this.userService.getKdfIterations(); const newKey = await this.cryptoService.makeKey(this.newMasterPassword, email, kdf, kdfIterations); request.newMasterPasswordHash = await this.cryptoService.hashPassword(this.newMasterPassword, newKey); - const encKey = await this.cryptoService.getEncKey(); - const newEncKey = await this.cryptoService.encrypt(encKey.key, newKey); - request.key = newEncKey.encryptedString; + const newEncKey = await this.cryptoService.remakeEncKey(newKey); + request.key = newEncKey[1].encryptedString; try { this.formPromise = this.apiService.postPassword(request); await this.formPromise;