From c99ffe3d8337462d7855dff93ac565d3a2c851b1 Mon Sep 17 00:00:00 2001 From: Timshel Date: Mon, 29 Jun 2026 10:09:52 +0200 Subject: [PATCH] Review fix --- src/api/core/accounts.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs index bd3d8820..623edf24 100644 --- a/src/api/core/accounts.rs +++ b/src/api/core/accounts.rs @@ -129,14 +129,17 @@ impl RegisterData { self.compat.fold(|rdc| &rdc.key, |rdcu| &rdcu.master_password_unlock.key).to_owned() } + // When comparing with salt, email need to be normalized: + // - https://github.com/bitwarden/clients/blob/web-v2026.5.0/libs/common/src/key-management/master-password/services/master-password.service.ts#L171 fn unprocessable(&self) -> bool { let mut unprocessable = false; *self.compat.fold( |_| &false, |rdcu| { + let email = self.email.trim().to_lowercase(); unprocessable = rdcu.master_password_authentication.kdf != rdcu.master_password_unlock.kdf - || rdcu.master_password_authentication.salt != self.email - || rdcu.master_password_unlock.salt != self.email; + || rdcu.master_password_authentication.salt != email + || rdcu.master_password_unlock.salt != email; &unprocessable }, )