1
0
mirror of https://github.com/bitwarden/server synced 2026-02-12 14:33:49 +00:00

fix(register): [PM-27084] Account Register Uses New Data Types - Added new checks for master password authentication data.

This commit is contained in:
Patrick Pimentel
2025-12-29 11:57:25 -05:00
parent 4f81d75292
commit fac1d4bdc2
4 changed files with 37 additions and 33 deletions

View File

@@ -607,7 +607,7 @@ public class AccountsControllerTests : IDisposable
{
Email = email,
EmailVerificationToken = emailVerificationToken,
MasterPasswordAuthenticationData = new MasterPasswordAuthenticationData
MasterPasswordAuthentication = new MasterPasswordAuthenticationData
{
Kdf = new KdfSettings
{
@@ -619,7 +619,7 @@ public class AccountsControllerTests : IDisposable
MasterPasswordAuthenticationHash = masterPasswordHash,
Salt = email // salt choice is not validated here during registration
},
MasterPasswordUnlockData = new MasterPasswordUnlockData
MasterPasswordUnlock = new MasterPasswordUnlockData
{
Kdf = new KdfSettings
{
@@ -725,7 +725,7 @@ public class AccountsControllerTests : IDisposable
Email = email,
OrgInviteToken = orgInviteToken,
OrganizationUserId = organizationUserId,
MasterPasswordAuthenticationData = new MasterPasswordAuthenticationData
MasterPasswordAuthentication = new MasterPasswordAuthenticationData
{
Kdf = new KdfSettings
{
@@ -735,7 +735,7 @@ public class AccountsControllerTests : IDisposable
MasterPasswordAuthenticationHash = masterPasswordHash,
Salt = email
},
MasterPasswordUnlockData = new MasterPasswordUnlockData
MasterPasswordUnlock = new MasterPasswordUnlockData
{
Kdf = new KdfSettings
{
@@ -842,14 +842,14 @@ public class AccountsControllerTests : IDisposable
{
Email = email,
EmailVerificationToken = emailVerificationToken,
MasterPasswordAuthenticationData = new MasterPasswordAuthenticationData
MasterPasswordAuthentication = new MasterPasswordAuthenticationData
{
// present but not used by ToUser for KDF/Key
Kdf = new KdfSettings { KdfType = KdfType.Argon2id, Iterations = iterations },
MasterPasswordAuthenticationHash = masterPasswordHash,
Salt = email
},
MasterPasswordUnlockData = new MasterPasswordUnlockData
MasterPasswordUnlock = new MasterPasswordUnlockData
{
Kdf = unlockKdf,
MasterKeyWrappedUserKey = masterKeyWrappedUserKey,
@@ -901,7 +901,7 @@ public class AccountsControllerTests : IDisposable
Kdf = KdfType.PBKDF2_SHA256,
KdfIterations = AuthConstants.PBKDF2_ITERATIONS.Default,
UserSymmetricKey = legacyKey,
MasterPasswordUnlockData = null,
MasterPasswordUnlock = null,
UserAsymmetricKeys = new KeysRequestModel
{
PublicKey = publicKey,
@@ -942,14 +942,14 @@ public class AccountsControllerTests : IDisposable
{
Email = email,
EmailVerificationToken = emailVerificationToken,
MasterPasswordAuthenticationData = new MasterPasswordAuthenticationData
MasterPasswordAuthentication = new MasterPasswordAuthenticationData
{
// present but ToUser does not source KDF from here
Kdf = new KdfSettings { KdfType = KdfType.Argon2id, Iterations = iterations },
MasterPasswordAuthenticationHash = masterPasswordHash,
Salt = email
},
MasterPasswordUnlockData = null,
MasterPasswordUnlock = null,
Kdf = null,
KdfIterations = iterations,
UserSymmetricKey = masterKeyWrappedUserKey,
@@ -980,14 +980,14 @@ public class AccountsControllerTests : IDisposable
{
Email = email,
EmailVerificationToken = emailVerificationToken,
MasterPasswordAuthenticationData = new MasterPasswordAuthenticationData
MasterPasswordAuthentication = new MasterPasswordAuthenticationData
{
// present but ToUser does not source iterations from here
Kdf = new KdfSettings { KdfType = kdfType, Iterations = AuthConstants.PBKDF2_ITERATIONS.Default },
MasterPasswordAuthenticationHash = masterPasswordHash,
Salt = email
},
MasterPasswordUnlockData = null,
MasterPasswordUnlock = null,
Kdf = kdfType,
KdfIterations = null,
UserSymmetricKey = masterKeyWrappedUserKey,
@@ -1018,13 +1018,13 @@ public class AccountsControllerTests : IDisposable
{
Email = email,
EmailVerificationToken = emailVerificationToken,
MasterPasswordAuthenticationData = new MasterPasswordAuthenticationData
MasterPasswordAuthentication = new MasterPasswordAuthenticationData
{
Kdf = new KdfSettings { KdfType = kdfType, Iterations = iterations },
MasterPasswordAuthenticationHash = masterPasswordHash,
Salt = email
},
MasterPasswordUnlockData = null,
MasterPasswordUnlock = null,
Kdf = kdfType,
KdfIterations = iterations,
UserSymmetricKey = null,