From bb07f844b046e027e761ca552a45ce83eaddc112 Mon Sep 17 00:00:00 2001 From: Keegan Caruso Date: Wed, 14 Aug 2024 16:01:07 -0700 Subject: [PATCH] Suppress SYSLIB0057 in tests --- .../HttpRequestDataTests.cs | 2 ++ .../WsFederationMessageTests.cs | 2 ++ test/Microsoft.IdentityModel.TestUtils/Default.cs | 4 ++++ test/Microsoft.IdentityModel.TestUtils/KeyingMaterial.cs | 3 ++- test/Microsoft.IdentityModel.TestUtils/ReferenceMetadata.cs | 2 ++ test/Microsoft.IdentityModel.TestUtils/TestSets.cs | 5 ++++- .../IdentityComparerTests.cs | 3 +++ .../JsonWebKeySetTests.cs | 2 ++ .../EnvelopedSignatureReaderTests.cs | 2 ++ test/Microsoft.IdentityModel.Xml.Tests/ReferenceTests.cs | 3 ++- 10 files changed, 25 insertions(+), 3 deletions(-) diff --git a/test/Microsoft.IdentityModel.Protocols.Tests/HttpRequestDataTests.cs b/test/Microsoft.IdentityModel.Protocols.Tests/HttpRequestDataTests.cs index 13a069ec00..5545132ebd 100644 --- a/test/Microsoft.IdentityModel.Protocols.Tests/HttpRequestDataTests.cs +++ b/test/Microsoft.IdentityModel.Protocols.Tests/HttpRequestDataTests.cs @@ -17,7 +17,9 @@ public void ClientCertificates() Assert.NotNull(httpRequestData.ClientCertificates); Assert.Empty(httpRequestData.ClientCertificates); +#pragma warning disable SYSLIB0057 // Type or member is obsolete var cert = new X509Certificate2(Convert.FromBase64String(KeyingMaterial.AADCertData)); +#pragma warning restore SYSLIB0057 // Type or member is obsolete httpRequestData.ClientCertificates.Add(cert); Assert.Single(httpRequestData.ClientCertificates); diff --git a/test/Microsoft.IdentityModel.Protocols.WsFederation.Tests/WsFederationMessageTests.cs b/test/Microsoft.IdentityModel.Protocols.WsFederation.Tests/WsFederationMessageTests.cs index ca5458d377..0f1126672b 100644 --- a/test/Microsoft.IdentityModel.Protocols.WsFederation.Tests/WsFederationMessageTests.cs +++ b/test/Microsoft.IdentityModel.Protocols.WsFederation.Tests/WsFederationMessageTests.cs @@ -143,7 +143,9 @@ public static TheoryData WaSignInTheoryData { TokenValidationParameters = new TokenValidationParameters { +#pragma warning disable SYSLIB0057 // Type or member is obsolete IssuerSigningKey = new X509SecurityKey(new X509Certificate2(Convert.FromBase64String(_x509DataADFS))), +#pragma warning restore SYSLIB0057 // Type or member is obsolete ValidIssuer = "http://sts.sub2.fracas365.msftonlinerepro.com/adfs/services/trust", ValidAudience = "https://app1.sub2.fracas365.msftonlinerepro.com/sampapp/", ValidateLifetime = false, diff --git a/test/Microsoft.IdentityModel.TestUtils/Default.cs b/test/Microsoft.IdentityModel.TestUtils/Default.cs index 9f96762c47..ac4272be37 100644 --- a/test/Microsoft.IdentityModel.TestUtils/Default.cs +++ b/test/Microsoft.IdentityModel.TestUtils/Default.cs @@ -195,7 +195,9 @@ public static string Binding get => "http://www.w3.org/"; } +#pragma warning disable SYSLIB0057 // Type or member is obsolete public static X509Certificate2 Certificate => new X509Certificate2(Convert.FromBase64String(CertificateData)); +#pragma warning restore SYSLIB0057 // Type or member is obsolete public static string CertificateData { @@ -262,6 +264,7 @@ public static HashAlgorithm HashAlgorithm get => SHA256.Create(); } +#pragma warning disable SYSLIB0057 // Type or member is obsolete public static KeyInfo KeyInfo { get @@ -271,6 +274,7 @@ public static KeyInfo KeyInfo return keyInfo; } } +#pragma warning restore SYSLIB0057 // Type or member is obsolete public static string IPAddress { diff --git a/test/Microsoft.IdentityModel.TestUtils/KeyingMaterial.cs b/test/Microsoft.IdentityModel.TestUtils/KeyingMaterial.cs index 9251fc487a..986d3d75e0 100644 --- a/test/Microsoft.IdentityModel.TestUtils/KeyingMaterial.cs +++ b/test/Microsoft.IdentityModel.TestUtils/KeyingMaterial.cs @@ -9,6 +9,7 @@ namespace Microsoft.IdentityModel.TestUtils { +#pragma warning disable SYSLIB0057 // Type or member is obsolete static public class KeyingMaterial { #if NET462 || NET472 @@ -19,7 +20,6 @@ static public class KeyingMaterial public static JsonWebKeySet AADJsonWebKeySet { get => new JsonWebKeySet(AADJWKS); } public static string AADCertData { get => "MIIDBTCCAe2gAwIBAgIQY4RNIR0dX6dBZggnkhCRoDANBgkqhkiG9w0BAQsFADAtMSswKQYDVQQDEyJhY2NvdW50cy5hY2Nlc3Njb250cm9sLndpbmRvd3MubmV0MB4XDTE3MDIxMzAwMDAwMFoXDTE5MDIxNDAwMDAwMFowLTErMCkGA1UEAxMiYWNjb3VudHMuYWNjZXNzY29udHJvbC53aW5kb3dzLm5ldDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMBEizU1OJms31S/ry7iav/IICYVtQ2MRPhHhYknHImtU03sgVk1Xxub4GD7R15i9UWIGbzYSGKaUtGU9lP55wrfLpDjQjEgaXi4fE6mcZBwa9qc22is23B6R67KMcVyxyDWei+IP3sKmCcMX7Ibsg+ubZUpvKGxXZ27YgqFTPqCT2znD7K81YKfy+SVg3uW6epW114yZzClTQlarptYuE2mujxjZtx7ZUlwc9AhVi8CeiLwGO1wzTmpd/uctpner6oc335rvdJikNmc1cFKCK+2irew1bgUJHuN+LJA0y5iVXKvojiKZ2Ii7QKXn19Ssg1FoJ3x2NWA06wc0CnruLsCAwEAAaMhMB8wHQYDVR0OBBYEFDAr/HCMaGqmcDJa5oualVdWAEBEMA0GCSqGSIb3DQEBCwUAA4IBAQAiUke5mA86R/X4visjceUlv5jVzCn/SIq6Gm9/wCqtSxYvifRXxwNpQTOyvHhrY/IJLRUp2g9/fDELYd65t9Dp+N8SznhfB6/Cl7P7FRo99rIlj/q7JXa8UB/vLJPDlr+NREvAkMwUs1sDhL3kSuNBoxrbLC5Jo4es+juQLXd9HcRraE4U3UZVhUS2xqjFOfaGsCbJEqqkjihssruofaxdKT1CPzPMANfREFJznNzkpJt4H0aMDgVzq69NxZ7t1JiIuc43xRjeiixQMRGMi1mAB75fTyfFJ/rWQ5J/9kh0HMZVtHsqICBF1tHMTMIK5rwoweY0cuCIpN7A/zMOQtoD"; } public static X509Certificate2 AADSigningCert { get => new X509Certificate2(Convert.FromBase64String(AADCertData)); } - public static SecureString SelfSigned1024_SHA256_Password = ConvertToSecureString("SelfSigned1024_SHA256"); public static SecureString SelfSigned2048_SHA256_Password = ConvertToSecureString("SelfSigned2048_SHA256"); public static SecureString SelfSigned2048_SHA256_2_Password = ConvertToSecureString("SelfSigned2048_SHA256_2"); @@ -1070,4 +1070,5 @@ private static SecureString ConvertToSecureString(string password) return securePassword; } } +#pragma warning restore SYSLIB0057 // Type or member is obsolete } diff --git a/test/Microsoft.IdentityModel.TestUtils/ReferenceMetadata.cs b/test/Microsoft.IdentityModel.TestUtils/ReferenceMetadata.cs index 02ae9ca34a..6b46ee4d15 100644 --- a/test/Microsoft.IdentityModel.TestUtils/ReferenceMetadata.cs +++ b/test/Microsoft.IdentityModel.TestUtils/ReferenceMetadata.cs @@ -10,6 +10,7 @@ namespace Microsoft.IdentityModel.TestUtils { +#pragma warning disable SYSLIB0057 // Type or member is obsolete public static class ReferenceMetadata { public static List MetadataSigningKeys @@ -1273,4 +1274,5 @@ public static string MetadataWithBlanks } } } +#pragma warning restore SYSLIB0057 // Type or member is obsolete } diff --git a/test/Microsoft.IdentityModel.TestUtils/TestSets.cs b/test/Microsoft.IdentityModel.TestUtils/TestSets.cs index c76fdb3451..de769ae455 100644 --- a/test/Microsoft.IdentityModel.TestUtils/TestSets.cs +++ b/test/Microsoft.IdentityModel.TestUtils/TestSets.cs @@ -272,6 +272,8 @@ public static TransformTestSet MultipleTransforms(int numberOfTransforms, string } } + +#pragma warning disable SYSLIB0057 // Type or member is obsolete public class KeyInfoTestSet : XmlTestSet { public KeyInfo KeyInfo @@ -750,6 +752,7 @@ public static KeyInfoTestSet RSAKeyValueEmpty } } } +#pragma warning disable SYSLIB0057 // Type or member is obsolete public class SignatureTestSet : XmlTestSet { @@ -1154,4 +1157,4 @@ public WsFederationMessage WsFederationMessage set; } } -} \ No newline at end of file +} diff --git a/test/Microsoft.IdentityModel.Tokens.Tests/IdentityComparerTests.cs b/test/Microsoft.IdentityModel.Tokens.Tests/IdentityComparerTests.cs index b803c8dc32..ec0a77dddc 100644 --- a/test/Microsoft.IdentityModel.Tokens.Tests/IdentityComparerTests.cs +++ b/test/Microsoft.IdentityModel.Tokens.Tests/IdentityComparerTests.cs @@ -647,8 +647,11 @@ public void CompareX509Certificate2() TestUtilities.WriteHeader($"{this}.CompareX509Certificate2", true); var context = new CompareContext($"{this}.CompareX509Certificate2"); +#pragma warning disable SYSLIB0057 // Type or member is obsolete var certificate = new X509Certificate2(Convert.FromBase64String(KeyingMaterial.DefaultX509Data_2048_Public)); var certificateSame = new X509Certificate2(Convert.FromBase64String(KeyingMaterial.DefaultX509Data_2048_Public)); +#pragma warning restore SYSLIB0057 // Type or member is obsolete + var certificateDifferent = KeyingMaterial.CertSelfSigned1024_SHA256; IdentityComparer.AreEqual(certificate, certificateSame, context); diff --git a/test/Microsoft.IdentityModel.Tokens.Tests/JsonWebKeySetTests.cs b/test/Microsoft.IdentityModel.Tokens.Tests/JsonWebKeySetTests.cs index 625e22f991..4603c9064d 100644 --- a/test/Microsoft.IdentityModel.Tokens.Tests/JsonWebKeySetTests.cs +++ b/test/Microsoft.IdentityModel.Tokens.Tests/JsonWebKeySetTests.cs @@ -426,10 +426,12 @@ private static X509SecurityKey CreateX509SecurityKey(JsonWebKeySet webKeySet, in { var webKey = (webKeySet.Keys as List)[keyIndex]; +#pragma warning disable SYSLIB0057 // Type or member is obsolete return new X509SecurityKey(new X509Certificate2(Convert.FromBase64String(webKey.X5c[0]))) { KeyId = webKey.KeyId }; +#pragma warning restore SYSLIB0057 // Type or member is obsolete } private static RsaSecurityKey CreateRsaSecurityKey(JsonWebKeySet webKeySet, int keyIndex) diff --git a/test/Microsoft.IdentityModel.Xml.Tests/EnvelopedSignatureReaderTests.cs b/test/Microsoft.IdentityModel.Xml.Tests/EnvelopedSignatureReaderTests.cs index 431fe671fe..a42d0f331d 100644 --- a/test/Microsoft.IdentityModel.Xml.Tests/EnvelopedSignatureReaderTests.cs +++ b/test/Microsoft.IdentityModel.Xml.Tests/EnvelopedSignatureReaderTests.cs @@ -213,8 +213,10 @@ public static TheoryData ReadXmlElementsTheoryData var samlString = CreateSamlTokenString(); var saml2String = CreateSaml2TokenString(); var samlpMesage = File.ReadAllText("SamlpMessage.xml"); +#pragma warning disable SYSLIB0057 // Type or member is obsolete var samlpTokenKey = new X509SecurityKey(new X509Certificate2(Convert.FromBase64String("MIIGvzCCBKegAwIBAgICAZUwDQYJKoZIhvcNAQELBQAwgYYxCzAJBgNVBAYTAkNaMQ8wDQYDVQQHEwZQcmFndWUxGTAXBgNVBAoTEENaLk5JQywgei5zLnAuby4xMTAvBgNVBAMTKENaLk5JQyBTSEEyIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxGDAWBgkqhkiG9w0BCQEWCWNhQG5pYy5jejAeFw0xODAyMDYxMDM5MDJaFw0yMDAyMDYxMDM5MDJaMH0xCzAJBgNVBAYTAkNaMQ8wDQYDVQQHEwZQcmFndWUxDzANBgNVBAoTBkNaLk5JQzEwMC4GA1UEAxMnbW9qZWlkLnJlZ3Rlc3QubmljLmN6IHNpZGFzYW1sIG1ldGFkYXRhMRowGAYJKoZIhvcNAQkBFgtyb290QG5pYy5jejCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANUq8haz+ZNnLBWRLPLQKSyg7TlQDVyLxxMmxFhCT8OXArkjIsZvcwNNeMDB6aOhk0Zs97t+7lEgC2MuiY9GnoC0DV+TAUf7+MzlHuE0oCmR9jiJPsikBEsRDHpvHi9rZv4HK2TCsee/5dDi7tP7bMnRvDOAt7lR+KuLQNaXtDWrXC4bjeNdO/mcy3UeKy+dW2Diqz8YMbRrxM29wAweaUSJ6npU9KTnx0/dq/+IM4R1gO62t+6vjxqiryEFcvdb6lGHc6qC9TYuHaGZBfXiT2goK4NbOr9dfLuixQ8Jd3oN88Qqt7r5u20VLCB06BIQHBgzJTHaSsi5MT5ymtx8lTpkR6MHXGue//QTZP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US6aC+ObKgGXq4MxoSV8lijMLEW9crCpFDoLLd3LQw0GjVk2mCE7XTuaT0choPYlZmjv+wF2ZKm5/B+Qjek2j7SkY1yn7hxgJdd5ljHE6wmDXLJ8gHuVBNwvc5iHDjHYh7jL5c5jCDBcr1fFCsIARU05RAkfpWurl8GKY8t6IPm7iopOLjru3Gl45ZBdVrAPMQ8Fz1M9VElUJ6ngeKkXHkSwGhCBG3X0MYsltND6mZSkJqN0nOs+cJ6HHO8IZW1f2pH3aCTUSDYWoaZbK74NC6d61sr5Rth4foLQnMzCS5RaXuANMvyZW3Ol5ScvLl/KRZM4f4CB6rmYinyHfXIoPF+uCjavyOYnW1RDBASg0Ld/WUJlWb75m5GNkRELIc4c5FU54ysMW9o5wnGpQvtXNdCBJK8tAyZO9Wf2hjZeOZgJ6r1IngfSeSFu7EOFqWnwVOF+3juwWOLCwxrKcURAEngwH01ydwU3oG/rN+7JtdS3IwfaBt9sfDiLQ60qec/6PQc643UztE6oToHLRXsidwrObwyAKLSFJoh/uxWT85JgAoekq5zBen94HfELfMEc9tex6Qlf1tLDs7OWD6Mlw6j9aAcw/4Nfh"))); +#pragma warning restore SYSLIB0057 // Type or member is obsolete var xmlWithTwoSamlTokens = CreateSignedXmlWithEmbededTokens(new List { CreateSamlToken(), CreateSamlToken() }, Default.SymmetricSigningCredentials, Default.AsymmetricSigningCredentials); var xmlWithSamlAndSaml2Tokens = CreateSignedXmlWithEmbededTokens(new List { CreateSamlToken(), CreateSaml2Token() }, Default.SymmetricSigningCredentials, Default.AsymmetricSigningCredentials); var xmlWithSaml2AndSamlTokens = CreateSignedXmlWithEmbededTokens(new List { CreateSaml2Token(), CreateSamlToken() }, Default.SymmetricSigningCredentials, Default.AsymmetricSigningCredentials); diff --git a/test/Microsoft.IdentityModel.Xml.Tests/ReferenceTests.cs b/test/Microsoft.IdentityModel.Xml.Tests/ReferenceTests.cs index ea45257e2f..d056aed485 100644 --- a/test/Microsoft.IdentityModel.Xml.Tests/ReferenceTests.cs +++ b/test/Microsoft.IdentityModel.Xml.Tests/ReferenceTests.cs @@ -7,7 +7,6 @@ using System.Xml; using Microsoft.IdentityModel.TestUtils; using Microsoft.IdentityModel.Tokens; -using Microsoft.IdentityModel.Xml; using Xunit; #pragma warning disable CS3016 // Arrays as attribute arguments is not CLS-compliant @@ -53,7 +52,9 @@ public void VerifyReference() // DigestValue>F/TMfVx/lEtqy4aGBzMyKPj/b5iyaEH9WyhUJ1EA724= //MIIDCDCCAfCgAwIBAgIQNz4YVbYAIJVFCc47HFD3RzANBgkqhkiG9w0BAQsFADBAMT4wPAYDVQQDEzVBREZTIFNpZ25pbmcgLSBzdHMuc3ViMi5mcmFjYXMzNjUubXNmdG9ubGluZXJlcHJvLmNvbTAeFw0xNTAzMzExMDQyMTNaFw0zNDA1MzAxMDQyMTNaMEAxPjA8BgNVBAMTNUFERlMgU2lnbmluZyAtIHN0cy5zdWIyLmZyYWNhczM2NS5tc2Z0b25saW5lcmVwcm8uY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxdjzB+wGV6hYekOvWwKoL/DFNBiLQsLx6w02FzcFnpGwR38gVTn/glg9CNSsOT0riRM3/MwU8o2fwseQyVtv9Kee/yvia8cB6GD0CARlYizb6GkJJzMvWkPSas1zpn10Bs3SBBgn0pvAKZCWWir5WJ7DRY32X2yo2do8mQftsoLGYsEU8+jj9AMYQWaR3A86AEWjXoQY3AodfMMzdVFX+O/kjsvKcBfPqGRT6jUSGBOOaqzMOJBT39SueD8zePDW7SejBl7fRi4TLx5H6xuMldOAAH6oD70yIrobqosGG9X/LdijHajMSoaYzZIlG7fl4PCVvAjh1Dytw/y8K70flQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBy08dAsSTKd2YlNE8bM4O5C2bFKR1YakR8L/zLEy8g+RNsKN5V/cIll0b/tf9iQ5464nc+nM///U+UVxqT8ipeR7ThIPwuWX98cFZFQNNGkha4PaYap/osquEpRAJOcTqZf2K95ipeQ+5Hhw00mK0hcV1QT/7maTUqCHDfBCaD+uYAFvaNBXOYpdoIGM9cMk7Qjc/yowLDm+DpmJek54MWmN+iZ0YtDEhMSh//QPFMLPT5Ucat+qRTen1HZNGdxfZ7NIIDL3dNKVDN+vDUbW7rjvPyxA8Rtj4JplI9ENqpzRq4m1sDWUTk2hJYw9Ec1kGo7AFKRmOS6DRbwUn5Ptdc +#pragma warning disable SYSLIB0057 // Type or member is obsolete var cert = new X509Certificate2(Convert.FromBase64String("MIIDCDCCAfCgAwIBAgIQNz4YVbYAIJVFCc47HFD3RzANBgkqhkiG9w0BAQsFADBAMT4wPAYDVQQDEzVBREZTIFNpZ25pbmcgLSBzdHMuc3ViMi5mcmFjYXMzNjUubXNmdG9ubGluZXJlcHJvLmNvbTAeFw0xNTAzMzExMDQyMTNaFw0zNDA1MzAxMDQyMTNaMEAxPjA8BgNVBAMTNUFERlMgU2lnbmluZyAtIHN0cy5zdWIyLmZyYWNhczM2NS5tc2Z0b25saW5lcmVwcm8uY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxdjzB+wGV6hYekOvWwKoL/DFNBiLQsLx6w02FzcFnpGwR38gVTn/glg9CNSsOT0riRM3/MwU8o2fwseQyVtv9Kee/yvia8cB6GD0CARlYizb6GkJJzMvWkPSas1zpn10Bs3SBBgn0pvAKZCWWir5WJ7DRY32X2yo2do8mQftsoLGYsEU8+jj9AMYQWaR3A86AEWjXoQY3AodfMMzdVFX+O/kjsvKcBfPqGRT6jUSGBOOaqzMOJBT39SueD8zePDW7SejBl7fRi4TLx5H6xuMldOAAH6oD70yIrobqosGG9X/LdijHajMSoaYzZIlG7fl4PCVvAjh1Dytw/y8K70flQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBy08dAsSTKd2YlNE8bM4O5C2bFKR1YakR8L/zLEy8g+RNsKN5V/cIll0b/tf9iQ5464nc+nM///U+UVxqT8ipeR7ThIPwuWX98cFZFQNNGkha4PaYap/osquEpRAJOcTqZf2K95ipeQ+5Hhw00mK0hcV1QT/7maTUqCHDfBCaD+uYAFvaNBXOYpdoIGM9cMk7Qjc/yowLDm+DpmJek54MWmN+iZ0YtDEhMSh//QPFMLPT5Ucat+qRTen1HZNGdxfZ7NIIDL3dNKVDN+vDUbW7rjvPyxA8Rtj4JplI9ENqpzRq4m1sDWUTk2hJYw9Ec1kGo7AFKRmOS6DRbwUn5Ptdc")); +#pragma warning restore SYSLIB0057 // Type or member is obsolete try { envelopedReader.Signature.Verify(new X509SecurityKey(cert), CryptoProviderFactory.Default);