Suppress credscan warnings in X.509 test files (#91080)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Thu, 24 Aug 2023 23:14:26 +0000 (16:14 -0700)
committerGitHub <noreply@github.com>
Thu, 24 Aug 2023 23:14:26 +0000 (16:14 -0700)
Co-authored-by: Levi Broderick <levib@microsoft.com>
src/libraries/System.Security.Cryptography/tests/X509Certificates/TestData.cs

index 7110c78..e3deb00 100644 (file)
@@ -51,7 +51,8 @@ namespace System.Security.Cryptography.X509Certificates.Tests
 
         // This pfx was generated by new X509Certificate(MsCertificate).Export(X509ContentType.Pfx)
         // and was choosen when the padding was 01 and caused a false-positive on decryption.
-        public static byte[] MsCertificateExportedToPfx_NullPassword = Convert.FromBase64String(@"
+        public static byte[] MsCertificateExportedToPfx_NullPassword = Convert.FromBase64String(
+            /* [SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="This PKCS#12 blob only contains public info.")] */ @"
 MIIFxAIBAzCCBYoGCSqGSIb3DQEHAaCCBXsEggV3MIIFczCCBW8GCSqGSIb3DQEH
 BqCCBWAwggVcAgEAMIIFVQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIKpCU
 u5nlxAACAggAgIIFKG/SLlS1TJmxGUiXBPJ1r4yV+JMehwo6RYPMkCSnpKGaiLyA
@@ -3057,7 +3058,8 @@ YvvL0LiXzFyomg==
             "4D7314FCB4041469835268466D1390373566F7034C4736346CD17D020207D0").HexToByteArray();
 
         internal static readonly byte[] Pkcs12NoPasswordRandomCounts =
-            Convert.FromBase64String(@"
+            Convert.FromBase64String(
+                /* [SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Self-signed cert created specifically for inclusion in public-facing unit tests.")] */ @"
                 MIIvdAIBAzCCLtQGCSqGSIb3DQEHAaCCLsUEgi7BMIIuvTCCLrkGCSqGSIb3DQEHAaCCLqoEgi6m
                 MIIuojCCAvkGCyqGSIb3DQEMCgECoIIC6DCCAuQwXgYJKoZIhvcNAQUNMFEwMAYJKoZIhvcNAQUM
                 MCMEELD+7LV5Y9tyUiJnNeZVLwQCASowDAYIKoZIhvcNAgsFADAdBglghkgBZQMEASoEEBzHfelA