1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-20 02:48:03 -05:00

Fix tests

This commit is contained in:
Bernd Schoolmann 2025-06-09 14:41:04 +02:00
parent ee857ed0e5
commit 18c562db6f
No known key found for this signature in database
2 changed files with 6 additions and 2 deletions

View File

@ -159,7 +159,7 @@ public class RotateUserAccountKeysCommand(
{
await ValidateRotationModelSignatureKeyPairForV2User(model, user);
}
else
else if (model.AccountKeys.SignatureKeyPairData != null)
{
ValidateRotationModelSignatureKeyPairForV1UserAndUpgradeToV2(model, user, saveEncryptedDataActions);
}

View File

@ -112,13 +112,15 @@ public class RotateUserAccountKeysCommandTests
}
[Theory, BitAutoData]
public async Task RotatesCorrectly(SutProvider<RotateUserAccountKeysCommand> sutProvider, User user,
public async Task RotatesCorrectlyV1Async(SutProvider<RotateUserAccountKeysCommand> sutProvider, User user,
RotateUserAccountKeysData model)
{
user.Kdf = Enums.KdfType.Argon2id;
user.KdfIterations = 3;
user.KdfMemory = 64;
user.KdfParallelism = 4;
user.PrivateKey = "2.xxx";
user.SignedPublicKey = null;
model.MasterPasswordUnlockData.Email = user.Email;
model.MasterPasswordUnlockData.KdfType = Enums.KdfType.Argon2id;
@ -127,6 +129,8 @@ public class RotateUserAccountKeysCommandTests
model.MasterPasswordUnlockData.KdfParallelism = 4;
model.AccountPublicKey = user.PublicKey;
model.UserKeyEncryptedAccountPrivateKey = "2.xxx";
model.AccountKeys.SignatureKeyPairData = null;
sutProvider.GetDependency<IUserService>().CheckPasswordAsync(user, model.OldMasterKeyAuthenticationHash)
.Returns(true);