1
0
mirror of https://github.com/bitwarden/server synced 2026-02-16 16:59:03 +00:00

fix(register): [PM-27084] Account Register Uses New Data Types - Removed invalid check.

This commit is contained in:
Patrick Pimentel
2025-12-30 16:06:59 -05:00
parent cc895d0598
commit 4475649bdc
3 changed files with 0 additions and 36 deletions

View File

@@ -113,9 +113,6 @@ public class RegisterFinishRequestModel : IValidatableObject
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
// PM-28143 - Remove line below
MasterPasswordUnlockDataRequestModel.ThrowIfExistsAndNotMatchingAuthenticationData(MasterPasswordAuthentication, MasterPasswordUnlock);
// PM-28143 - Remove line below
MasterPasswordAuthenticationDataRequestModel.ThrowIfExistsAndHashIsNotEqual(MasterPasswordAuthentication, MasterPasswordHash);

View File

@@ -19,31 +19,4 @@ public class MasterPasswordUnlockDataRequestModel
Salt = Salt
};
}
public static void ThrowIfExistsAndNotMatchingAuthenticationData(
MasterPasswordAuthenticationDataRequestModel? authenticationData,
MasterPasswordUnlockDataRequestModel? unlockData)
{
if (unlockData != null && authenticationData != null)
{
var matches = MatchesAuthenticationData(
unlockData,
authenticationData);
if (!matches)
{
throw new Exception("KDF settings and salt must match between authentication and unlock data.");
}
}
}
private static bool MatchesAuthenticationData(
MasterPasswordUnlockDataRequestModel unlockData,
MasterPasswordAuthenticationDataRequestModel authenticationData)
{
var kdfMatches = unlockData.Kdf.Equals(authenticationData.Kdf);
var saltMatches = unlockData.Salt == authenticationData.Salt;
return kdfMatches && saltMatches;
}
}

View File

@@ -3,12 +3,6 @@ using Bit.Core.Exceptions;
namespace Bit.Core.KeyManagement.Models.Data;
/// <summary>
/// The data used for authentication of a master password.
///
/// This data model does not have any validation, consider using MasterPasswordAuthenticationDataRequestModel
/// if validation is required.
/// </summary>
public class MasterPasswordAuthenticationData
{
public required KdfSettings Kdf { get; init; }