From 1edff74b30f7dcc928d7cf769e504c0d0d25227f Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 15 Dec 2025 18:36:16 +0100 Subject: [PATCH] Use proof of decryption (#17903) --- .../prompt-migration-password.component.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libs/angular/src/key-management/encrypted-migration/prompt-migration-password.component.ts b/libs/angular/src/key-management/encrypted-migration/prompt-migration-password.component.ts index 060901d68fb..59fec1a6f70 100644 --- a/libs/angular/src/key-management/encrypted-migration/prompt-migration-password.component.ts +++ b/libs/angular/src/key-management/encrypted-migration/prompt-migration-password.component.ts @@ -5,8 +5,7 @@ import { filter, firstValueFrom, map } from "rxjs"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; -import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction"; -import { VerificationType } from "@bitwarden/common/auth/enums/verification-type"; +import { MasterPasswordUnlockService } from "@bitwarden/common/key-management/master-password/abstractions/master-password-unlock.service"; import { LinkModule, AsyncActionsModule, @@ -39,7 +38,7 @@ import { export class PromptMigrationPasswordComponent { private dialogRef = inject(DialogRef); private formBuilder = inject(FormBuilder); - private uvService = inject(UserVerificationService); + private masterPasswordUnlockService = inject(MasterPasswordUnlockService); private accountService = inject(AccountService); migrationPasswordForm = this.formBuilder.group({ @@ -57,23 +56,21 @@ export class PromptMigrationPasswordComponent { return; } - const { userId, email } = await firstValueFrom( + const { userId } = await firstValueFrom( this.accountService.activeAccount$.pipe( filter((account) => account != null), map((account) => { return { userId: account!.id, - email: account!.email, }; }), ), ); if ( - !(await this.uvService.verifyUserByMasterPassword( - { type: VerificationType.MasterPassword, secret: masterPasswordControl.value }, + !(await this.masterPasswordUnlockService.proofOfDecryption( + masterPasswordControl.value, userId, - email, )) ) { return;