1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-19 18:38:03 -05:00

Fix cases for request data conversion

This commit is contained in:
Bernd Schoolmann 2025-06-16 11:32:00 +02:00
parent 54aac8cfc4
commit dbb4aca1e2
No known key found for this signature in database

View File

@ -15,7 +15,7 @@ public class AccountKeysRequestModel
public UserAccountKeysData ToAccountKeysData()
{
// This will be cleaned up, after a compatibility period, at which point PublicKeyEncryptionKeyPair and SignatureKeyPair will be required.
if (PublicKeyEncryptionKeyPair == null || SignatureKeyPair == null)
if (PublicKeyEncryptionKeyPair == null)
{
return new UserAccountKeysData
{
@ -27,6 +27,15 @@ public class AccountKeysRequestModel
};
}
else
{
if (SignatureKeyPair == null)
{
return new UserAccountKeysData
{
PublicKeyEncryptionKeyPairData = PublicKeyEncryptionKeyPair.ToPublicKeyEncryptionKeyPairData(),
};
}
else
{
return new UserAccountKeysData
{
@ -35,4 +44,5 @@ public class AccountKeysRequestModel
};
}
}
}
}