From 50298fbbce4227bbd5c9f90d28fcf4ae30d3edab Mon Sep 17 00:00:00 2001 From: Patrick Pimentel Date: Thu, 11 Dec 2025 13:07:28 -0500 Subject: [PATCH] fix(auth-validator): [PM-22975] Client Version Validator - Fixed tests and made versions of the sha obsolete --- src/Core/Enums/EncryptionType.cs | 3 +++ test/Common/Constants/TestEncryptionConstants.cs | 5 +---- .../KeyManagement/Utilities/EncryptionParsingTests.cs | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Core/Enums/EncryptionType.cs b/src/Core/Enums/EncryptionType.cs index 52231e047c..02de7c71ac 100644 --- a/src/Core/Enums/EncryptionType.cs +++ b/src/Core/Enums/EncryptionType.cs @@ -11,8 +11,11 @@ public enum EncryptionType : byte XChaCha20Poly1305_B64 = 7, // asymmetric + [Obsolete("Should probably be removed as it is not known to exist in the real world")] Rsa2048_OaepSha256_B64 = 3, Rsa2048_OaepSha1_B64 = 4, + [Obsolete("Should probably be removed as it is not known to exist in the real world")] Rsa2048_OaepSha256_HmacSha256_B64 = 5, + [Obsolete("Should probably be removed as it is not known to exist in the real world")] Rsa2048_OaepSha1_HmacSha256_B64 = 6 } diff --git a/test/Common/Constants/TestEncryptionConstants.cs b/test/Common/Constants/TestEncryptionConstants.cs index c6fb7fac78..08022fa83d 100644 --- a/test/Common/Constants/TestEncryptionConstants.cs +++ b/test/Common/Constants/TestEncryptionConstants.cs @@ -4,15 +4,12 @@ public static class TestEncryptionConstants { // Simple stubs for different encrypted string versions + [Obsolete] public const string AES256_CBC_B64_Encstring = "0.stub"; - public const string AES128_CBC_HMACSHA256_B64_Encstring = "1.stub"; public const string AES256_CBC_HMAC_EmptySuffix = "2."; // Intended for use as a V1 encrypted string, accepted by validators public const string AES256_CBC_HMAC_Encstring = "2.QmFzZTY0UGFydA==|QmFzZTY0UGFydA==|QmFzZTY0UGFydA=="; - public const string RSA2048_OAEPSHA256_B64_Encstring = "3.stub"; public const string RSA2048_OAEPSHA1_B64_Encstring = "4.stub"; - public const string RSA2048_OAEPSHA256_HMACSHA256_B64_Encstring = "5.stub"; - public const string RSA2048_OAEPSHA1_HMACSHA256_B64_Encstring = "6.stub"; public const string XCHACHA20POLY1305_B64_Encstring = "7.stub"; // Public key test placeholder diff --git a/test/Core.Test/KeyManagement/Utilities/EncryptionParsingTests.cs b/test/Core.Test/KeyManagement/Utilities/EncryptionParsingTests.cs index c68aa8a7a3..9647a6ca68 100644 --- a/test/Core.Test/KeyManagement/Utilities/EncryptionParsingTests.cs +++ b/test/Core.Test/KeyManagement/Utilities/EncryptionParsingTests.cs @@ -25,12 +25,8 @@ public class EncryptionParsingTests [Theory] [InlineData(TestEncryptionConstants.AES256_CBC_B64_Encstring, EncryptionType.AesCbc256_B64)] - [InlineData(TestEncryptionConstants.AES128_CBC_HMACSHA256_B64_Encstring, EncryptionType.AesCbc128_HmacSha256_B64)] [InlineData(TestEncryptionConstants.AES256_CBC_HMAC_Encstring, EncryptionType.AesCbc256_HmacSha256_B64)] - [InlineData(TestEncryptionConstants.RSA2048_OAEPSHA256_B64_Encstring, EncryptionType.Rsa2048_OaepSha256_B64)] [InlineData(TestEncryptionConstants.RSA2048_OAEPSHA1_B64_Encstring, EncryptionType.Rsa2048_OaepSha1_B64)] - [InlineData(TestEncryptionConstants.RSA2048_OAEPSHA256_HMACSHA256_B64_Encstring, EncryptionType.Rsa2048_OaepSha256_HmacSha256_B64)] - [InlineData(TestEncryptionConstants.RSA2048_OAEPSHA1_HMACSHA256_B64_Encstring, EncryptionType.Rsa2048_OaepSha1_HmacSha256_B64)] [InlineData(TestEncryptionConstants.V2PrivateKey, EncryptionType.XChaCha20Poly1305_B64)] [InlineData(TestEncryptionConstants.V2WrappedSigningKey, EncryptionType.XChaCha20Poly1305_B64)] [InlineData(TestEncryptionConstants.AES256_CBC_HMAC_EmptySuffix, EncryptionType.AesCbc256_HmacSha256_B64)] // empty suffix still valid