1
0
mirror of https://github.com/bitwarden/server synced 2026-01-02 16:43:25 +00:00

fix(auth-validator): [PM-22975] Client Version Validator - Added more tests and added comment.

This commit is contained in:
Patrick Pimentel
2025-12-04 09:24:27 -05:00
parent f719763a85
commit cff2f5df6d
2 changed files with 42 additions and 0 deletions

View File

@@ -222,6 +222,11 @@ public class User : ITableObject<Guid>, IStorableSubscriber, IRevisable, ITwoFac
return EncryptionParsing.GetEncryptionType(PrivateKey) == EncryptionType.XChaCha20Poly1305_B64;
}
/// <summary>
/// This technically is correct but all versions after 1 are considered v2 encryption. Leaving for now with
/// KM's blessing that when a new version comes along they will handle migration.
/// </summary>
/// <returns></returns>
private bool IsSecurityVersionTwo()
{
return SecurityVersion == 2;