From 5eee03d631184c072d8dd8956dff961e73216734 Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Thu, 18 Feb 2021 10:50:14 -0500 Subject: [PATCH 1/2] Use newer microsoft.com certificate chain. The old certificate chain used a root certificate that is deprecated and is starting to disappear from some trust stores. The removal of the root certificate led to a few failing tests, and other tests not running since they were conditional on the trust of that certificate. --- .../tests/CertTests.cs | 8 +- .../tests/ChainTests.cs | 24 +- .../tests/CollectionTests.cs | 6 +- .../tests/TestData.cs | 234 ++++++++++++------ 4 files changed, 171 insertions(+), 101 deletions(-) diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertTests.cs index cdf719833f7f5..79712e9a18add 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CertTests.cs @@ -104,15 +104,15 @@ public void TestVerify() { bool success; - using (var microsoftDotCom = new X509Certificate2(TestData.MicrosoftDotComSslCertBytes)) + using (var microsoftDotCom = new X509Certificate2(TestData.MicrosoftDotComLegacySslCertBytes)) { // Fails because expired (NotAfter = 10/16/2016) - Assert.False(microsoftDotCom.Verify(), "MicrosoftDotComSslCertBytes"); + Assert.False(microsoftDotCom.Verify(), "MicrosoftDotComLegacySslCertBytes"); } using (var microsoftDotComIssuer = new X509Certificate2(TestData.MicrosoftDotComIssuerBytes)) { - // NotAfter=10/31/2023 + // NotAfter=10/8/2024, 7:00:00 AM UTC success = microsoftDotComIssuer.Verify(); if (!success) { @@ -128,7 +128,7 @@ public void TestVerify() { using (var microsoftDotComRoot = new X509Certificate2(TestData.MicrosoftDotComRootBytes)) { - // NotAfter=7/17/2036 + // NotAfter=7/17/2025 success = microsoftDotComRoot.Verify(); if (!success) { diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs index e3a30b43c73b0..9cdf3b85eb71d 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs @@ -23,7 +23,7 @@ private static bool TrustsMicrosoftDotComRoot using (var chainHolder = new ChainHolder()) { X509Chain chain = chainHolder.Chain; - chain.ChainPolicy.VerificationTime = new DateTime(2015, 10, 15, 12, 01, 01, DateTimeKind.Local); + chain.ChainPolicy.VerificationTime = new DateTime(2021, 02, 26, 12, 01, 01, DateTimeKind.Local); chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; return chain.Build(microsoftDotCom); @@ -49,7 +49,7 @@ public static void BuildChain() // Halfway between microsoftDotCom's NotBefore and NotAfter // This isn't a boundary condition test. - chain.ChainPolicy.VerificationTime = new DateTime(2015, 10, 15, 12, 01, 01, DateTimeKind.Local); + chain.ChainPolicy.VerificationTime = new DateTime(2021, 02, 26, 12, 01, 01, DateTimeKind.Local); chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; bool valid = chain.Build(microsoftDotCom); @@ -81,7 +81,7 @@ public static void VerifyChainFromHandle() chain.ChainPolicy.ExtraStore.Add(microsoftDotComRoot); chain.ChainPolicy.ExtraStore.Add(microsoftDotComIssuer); chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority; - chain.ChainPolicy.VerificationTime = new DateTime(2015, 10, 15, 12, 01, 01, DateTimeKind.Local); + chain.ChainPolicy.VerificationTime = new DateTime(2021, 02, 26, 12, 01, 01, DateTimeKind.Local); chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; bool valid = chain.Build(microsoftDotCom); @@ -112,7 +112,7 @@ public static void VerifyChainFromHandle() // Re-set the ChainPolicy properties chain2.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority; - chain2.ChainPolicy.VerificationTime = new DateTime(2015, 10, 15, 12, 01, 01, DateTimeKind.Local); + chain2.ChainPolicy.VerificationTime = new DateTime(2021, 02, 26, 12, 01, 01, DateTimeKind.Local); chain2.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; valid = chain2.Build(microsoftDotCom); @@ -130,7 +130,7 @@ public static void VerifyChainFromHandle_Unix() { X509Chain chain = chainHolder.Chain; chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority; - chain.ChainPolicy.VerificationTime = new DateTime(2015, 10, 15, 12, 01, 01, DateTimeKind.Local); + chain.ChainPolicy.VerificationTime = new DateTime(2021, 02, 26, 12, 01, 01, DateTimeKind.Local); chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; bool valid = chain.Build(microsoftDotCom); @@ -152,7 +152,7 @@ public static void TestDispose() { chain = chainHolder.Chain; chain.ChainPolicy.VerificationFlags = X509VerificationFlags.AllowUnknownCertificateAuthority; - chain.ChainPolicy.VerificationTime = new DateTime(2015, 10, 15, 12, 01, 01, DateTimeKind.Local); + chain.ChainPolicy.VerificationTime = new DateTime(2021, 02, 26, 12, 01, 01, DateTimeKind.Local); chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; chain.Build(microsoftDotCom); @@ -371,14 +371,14 @@ public static void Invalidx509ChainTrustMode(int trustMode) public static IEnumerable VerifyExpressionData() { // The test will be using the chain for TestData.MicrosoftDotComSslCertBytes - // The leaf cert (microsoft.com) is valid from 2014-10-15 00:00:00Z to 2016-10-15 23:59:59Z + // The leaf cert (microsoft.com) is valid from 2020-08-28 22:17:02Z to 2021-08-28 22:17:02Z DateTime[] validTimes = { // The NotBefore value - new DateTime(2014, 10, 15, 0, 0, 0, DateTimeKind.Utc), + new DateTime(2020, 08, 28, 22, 17, 02, DateTimeKind.Utc), // One second before the NotAfter value - new DateTime(2016, 10, 15, 23, 59, 58, DateTimeKind.Utc), + new DateTime(2021, 08, 28, 22, 17, 01, DateTimeKind.Utc), }; // The NotAfter value as a boundary condition differs on Windows and OpenSSL. @@ -390,10 +390,10 @@ public static IEnumerable VerifyExpressionData() DateTime[] invalidTimes = { // One second before the NotBefore time - new DateTime(2014, 10, 14, 23, 59, 59, DateTimeKind.Utc), + new DateTime(2020, 08, 28, 22, 17, 01, DateTimeKind.Utc), // One second after the NotAfter time - new DateTime(2016, 10, 16, 0, 0, 0, DateTimeKind.Utc), + new DateTime(2021, 08, 28, 22, 17, 03, DateTimeKind.Utc), }; List testCases = new List((validTimes.Length + invalidTimes.Length) * 3); @@ -684,7 +684,7 @@ public static void BuildChain_MicrosoftDotCom_WithRootCertInUserAndSystemRootCer } X509Chain chainValidator = chainHolder.Chain; - chainValidator.ChainPolicy.VerificationTime = new DateTime(2015, 10, 15, 12, 01, 01, DateTimeKind.Local); + chainValidator.ChainPolicy.VerificationTime = new DateTime(2021, 02, 26, 12, 01, 01, DateTimeKind.Local); chainValidator.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; bool chainBuildResult = chainValidator.Build(microsoftDotCom); diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs index 33d6265558a28..7c08cdb1280d1 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/CollectionTests.cs @@ -809,7 +809,7 @@ public static void ExportMultiplePrivateKeys() Assert.Equal(2, originalPrivateKeyCount); byte[] exported = collection.Export(X509ContentType.Pkcs12); - + using (ImportedCollection ic = Cert.Import(exported)) { X509Certificate2Collection importedCollection = ic.Collection; @@ -1305,7 +1305,7 @@ public static void X509ChainElementCollection_IndexerVsEnumerator() // Halfway between microsoftDotCom's NotBefore and NotAfter // This isn't a boundary condition test. - chain.ChainPolicy.VerificationTime = new DateTime(2015, 10, 15, 12, 01, 01, DateTimeKind.Local); + chain.ChainPolicy.VerificationTime = new DateTime(2021, 02, 26, 12, 01, 01, DateTimeKind.Local); chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; bool valid = chain.Build(microsoftDotCom); @@ -1465,7 +1465,7 @@ public static void ImportFromPem_MultiplePems_Success() public static void ImportFromPemFile_MultiplePems_Success() { string pemAggregate = TestData.RsaCertificate + TestData.ECDsaCertificate; - + using (TempFileHolder aggregatePemFile = new TempFileHolder(pemAggregate)) using(ImportedCollection ic = Cert.ImportFromPemFile(aggregatePemFile.FilePath)) { diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/TestData.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/TestData.cs index 007c60d601c4f..3d02169eccace 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/TestData.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/TestData.cs @@ -1113,7 +1113,7 @@ public static SecureString CreatePfxDataPasswordSecureString() 6K/NomR2MQA= -----END PKCS7-----"); - internal static readonly byte[] MicrosoftDotComSslCertBytes = ( + internal static readonly byte[] MicrosoftDotComLegacySslCertBytes = ( "308205943082047CA00302010202103DF70C5D9903F8D8868B9B8CCF20DF6930" + "0D06092A864886F70D01010B05003077310B3009060355040613025553311D30" + "1B060355040A131453796D616E74656320436F72706F726174696F6E311F301D" + @@ -1160,90 +1160,160 @@ public static SecureString CreatePfxDataPasswordSecureString() "697B4203720483BB5794455B597D80D48CD3A1D73CBBC609C058767D1FF060A6" + "09D7E3D4317079AF0CD0A8A49251AB129157F9894A036487").HexToByteArray(); + internal static readonly byte[] MicrosoftDotComSslCertBytes = ( + "3082087930820661a00302010202136b000003f4e3a67a2348550c330000" + + "000003f4300d06092a864886f70d01010b0500304f310b30090603550406" + + "13025553311e301c060355040a13154d6963726f736f667420436f72706f" + + "726174696f6e3120301e060355040313174d6963726f736f667420525341" + + "20544c53204341203031301e170d3230303832383232313730325a170d32" + + "31303832383232313730325a308188310b3009060355040613025553310b" + + "30090603550408130257413110300e060355040713075265646d6f6e6431" + + "1e301c060355040a13154d6963726f736f667420436f72706f726174696f" + + "6e311e301c060355040b13154d6963726f736f667420436f72706f726174" + + "696f6e311a3018060355040313117777772e6d6963726f736f66742e636f" + + "6d30820122300d06092a864886f70d01010105000382010f003082010a02" + + "82010100c69ea6351173387784f57cd1af5de2b7e7752f954fc2fc66d045" + + "66be4922566ded721fdda0e23d6e542c4d5b663546a9410dc27818fbef40" + + "c2ceff2e3c9a6944fdcd5e62228a7e12b9a2beb6b52118d24e176991f1b0" + + "4465789607cb06cb2315cc1698ef140bb8962f0139854e21ea2ac0610723" + + "4034594aae4cf6e63d3f3c039a6f9e535721fce2347c055579ef73d04d12" + + "7c8f8c69c4889be5674a85aec9fe631fe9836aee734f21b0bdf88c16b462" + + "8ad735052849d98b497f4997733477827de4584ea01bca09572b40dcbc34" + + "ccd42af6c42214b8c6c3b5a708d8d40c8916bfec4e1d8da184de4342b40d" + + "8134189587b381c707d42719de822de64ff277c10203010001a382041230" + + "82040e30820104060a2b06010401d6790204020481f50481f200f0007600" + + "f65c942fd1773022145418083094568ee34d131933bfdf0c2f200bcc4ef1" + + "64e300000174372e743d0000040300473045022100930438131ebc6c1a6d" + + "b83517ebbfcfecb5dd5d4899edc83d5539a79f59382005022024609430a9" + + "cf09344c0f88b848adf62cbfd421ffe756b076f7263f2ff0cb00ed007600" + + "4494652eb0eeceafc44007d8a8fe28c0dae682bed8cb31b53fd33396b5b6" + + "81a800000174372e745000000403004730450221009bd86214f6f66215b8" + + "ca63e61f87dd1cf443af22dbeecec5ab2c6c16fc40b0ad0220267015da53" + + "5c1b557e8c8f9119a8c896d557a31277d9a87e9aee2ce6fdae979f302706" + + "092b060104018237150a041a3018300a06082b06010505070302300a0608" + + "2b06010505070301303d06092b06010401823715070430302e06262b0601" + + "04018237150887da867583eed90182c9851b81b59e6185f4eb60815db9f8" + + "108691d07802016402012330818706082b06010505070101047b30793053" + + "06082b060105050730028647687474703a2f2f7777772e6d6963726f736f" + + "66742e636f6d2f706b692f6d73636f72702f4d6963726f736f6674253230" + + "525341253230544c53253230434125323030312e637274302206082b0601" + + "05050730018616687474703a2f2f6f6373702e6d736f6373702e636f6d30" + + "1d0603551d0e041604148c75c331eb0496672786a7168161398fbc17bb38" + + "300b0603551d0f0404030204b03081990603551d1104819130818e821377" + + "777771612e6d6963726f736f66742e636f6d82117777772e6d6963726f73" + + "6f66742e636f6d8218737461746963766965772e6d6963726f736f66742e" + + "636f6d8211692e732d6d6963726f736f66742e636f6d820d6d6963726f73" + + "6f66742e636f6d8211632e732d6d6963726f736f66742e636f6d82157072" + + "69766163792e6d6963726f736f66742e636f6d3081b00603551d1f0481a8" + + "3081a53081a2a0819fa0819c864d687474703a2f2f6d7363726c2e6d6963" + + "726f736f66742e636f6d2f706b692f6d73636f72702f63726c2f4d696372" + + "6f736f6674253230525341253230544c53253230434125323030312e6372" + + "6c864b687474703a2f2f63726c2e6d6963726f736f66742e636f6d2f706b" + + "692f6d73636f72702f63726c2f4d6963726f736f66742532305253412532" + + "30544c53253230434125323030312e63726c30570603551d200450304e30" + + "4206092b0601040182372a013035303306082b0601050507020116276874" + + "74703a2f2f7777772e6d6963726f736f66742e636f6d2f706b692f6d7363" + + "6f72702f6370733008060667810c010202301f0603551d23041830168014" + + "b5760c3011cec792424d4cc75c2cc8a90ce80b64301d0603551d25041630" + + "1406082b0601050507030206082b06010505070301300d06092a864886f7" + + "0d01010b050003820201004a69de19b185c500841e607746e90c40e37298" + + "e16ea7c6d6f5517c2efbac51f7f5789213fcb61ba98093bfb17a73e47d78" + + "273e21c8fd47dbe992065ea83971b6704766dd561f530d15d58acde25d91" + + "13322a3ca2b1d6bcf454879738a5c350f675e019dd5f67637d0c9265279e" + + "d528d2e532f5f131f80133251ab58e3bcb018bdd75ba608f348a53a27931" + + "2e68ae08aa26cc521f9db5b30743d94c7eb49c10563a07379a9cb0d8f48c" + + "c5efc960bf331d0a9ba43e059f07cfdeb2c3a09e9ef2c0611c5dd6b7af7c" + + "ecfa99942291d1971eac307fa598570e150d3d2aa07e2e66303d6c1c52e1" + + "d8dc08b4b1f79898f442ea41e520b1240ecad11eef25fcc4e7a8f76bb2b4" + + "6c1bf084f14d3ab84c5ee27b5623280ccceb086d700f07139b792202cfca" + + "76da55075097d7b1e4011a1008fec3f48750d15b06290da418c9b7460fd8" + + "0e0e2ca0b8b360ba60f411512ecc38a301d2943b48c193cc25cf160007ad" + + "1c30c7cd98a4571ca68295727a3bf95ab76e1020c45ee16e661530c88bf5" + + "26e56b4d038eb8882940d78e82038484a3ea581c86bd0d7959d10e185174" + + "ec060030f3ad6541c4797a301aed40d42cd30fd21d7f0d58b6801e383c19" + + "0fd4bf9263f72c1ed260370b1add02cf6489898b8c3ae078cb04712d1d07" + + "3e84756b54b0281649eb9a05e05ef1e939184f9a9244471277b2dd11385d" + + "af125671c3331768048c27aed2").HexToByteArray(); + internal static readonly byte[] MicrosoftDotComIssuerBytes = ( - "3082052B30820413A00302010202107EE14A6F6FEFF2D37F3FAD654D3ADAB430" + - "0D06092A864886F70D01010B05003081CA310B30090603550406130255533117" + - "3015060355040A130E566572695369676E2C20496E632E311F301D060355040B" + - "1316566572695369676E205472757374204E6574776F726B313A303806035504" + - "0B1331286329203230303620566572695369676E2C20496E632E202D20466F72" + - "20617574686F72697A656420757365206F6E6C79314530430603550403133C56" + - "6572695369676E20436C6173732033205075626C6963205072696D6172792043" + - "657274696669636174696F6E20417574686F72697479202D204735301E170D31" + - "33313033313030303030305A170D3233313033303233353935395A3077310B30" + - "09060355040613025553311D301B060355040A131453796D616E74656320436F" + - "72706F726174696F6E311F301D060355040B131653796D616E74656320547275" + - "7374204E6574776F726B312830260603550403131F53796D616E74656320436C" + - "61737320332045562053534C204341202D20473330820122300D06092A864886" + - "F70D01010105000382010F003082010A0282010100D8A1657423E82B64E232D7" + - "33373D8EF5341648DD4F7F871CF84423138EFB11D8445A18718E601626929BFD" + - "170BE1717042FEBFFA1CC0AAA3A7B571E8FF1883F6DF100A1362C83D9CA7DE2E" + - "3F0CD91DE72EFB2ACEC89A7F87BFD84C041532C9D1CC9571A04E284F84D935FB" + - "E3866F9453E6728A63672EBE69F6F76E8E9C6004EB29FAC44742D27898E3EC0B" + - "A592DCB79ABD80642B387C38095B66F62D957A86B2342E859E900E5FB75DA451" + - "72467013BF67F2B6A74D141E6CB953EE231A4E8D48554341B189756A4028C57D" + - "DDD26ED202192F7B24944BEBF11AA99BE3239AEAFA33AB0A2CB7F46008DD9F1C" + - "CDDD2D016680AFB32F291D23B88AE1A170070C340F0203010001A382015D3082" + - "0159302F06082B0601050507010104233021301F06082B060105050730018613" + - "687474703A2F2F73322E73796D63622E636F6D30120603551D130101FF040830" + - "060101FF02010030650603551D20045E305C305A0604551D2000305230260608" + - "2B06010505070201161A687474703A2F2F7777772E73796D617574682E636F6D" + - "2F637073302806082B06010505070202301C1A1A687474703A2F2F7777772E73" + - "796D617574682E636F6D2F72706130300603551D1F042930273025A023A02186" + - "1F687474703A2F2F73312E73796D63622E636F6D2F706361332D67352E63726C" + - "300E0603551D0F0101FF04040302010630290603551D1104223020A41E301C31" + - "1A30180603550403131153796D616E746563504B492D312D353333301D060355" + - "1D0E041604140159ABE7DD3A0B59A66463D6CF200757D591E76A301F0603551D" + - "230418301680147FD365A7C2DDECBBF03009F34339FA02AF333133300D06092A" + - "864886F70D01010B050003820101004201557BD0161A5D58E8BB9BA84DD7F3D7" + - "EB139486D67F210B47BC579B925D4F059F38A4107CCF83BE0643468D08BC6AD7" + - "10A6FAABAF2F61A863F265DF7F4C8812884FB369D9FF27C00A97918F56FB89C4" + - "A8BB922D1B73B0C6AB36F4966C2008EF0A1E6624454F670040C8075474333BA6" + - "ADBB239F66EDA2447034FB0EEA01FDCF7874DFA7AD55B75F4DF6D63FE086CE24" + - "C742A9131444354BB6DFC960AC0C7FD993214BEE9CE4490298D3607B5CBCD530" + - "2F07CE4442C40B99FEE69FFCB07886516DD12C9DC696FB8582BB042FF76280EF" + - "62DA7FF60EAC90B856BD793FF2806EA3D9B90F5D3A071D9193864B294CE1DCB5" + - "E1E0339DB3CB36914BFEA1B4EEF0F9").HexToByteArray(); + "3082055a30820442a00302010202100f14965f202069994fd5c7ac788941" + + "e2300d06092a864886f70d01010b0500305a310b30090603550406130249" + + "4531123010060355040a130942616c74696d6f726531133011060355040b" + + "130a43796265725472757374312230200603550403131942616c74696d6f" + + "7265204379626572547275737420526f6f74301e170d3230303732313233" + + "303030305a170d3234313030383037303030305a304f310b300906035504" + + "0613025553311e301c060355040a13154d6963726f736f667420436f7270" + + "6f726174696f6e3120301e060355040313174d6963726f736f6674205253" + + "4120544c5320434120303130820222300d06092a864886f70d0101010500" + + "0382020f003082020a0282020100aa6277cf9a63b20684f39036f499f314" + + "51abea950a3b4606fd11411ffe5b0658c9386e08fc4f4448cd3aa4f7bd1e" + + "a2e295b8be5120c5bfb270635d780c43c029cd64490996daafcefd055f2b" + + "2a91e8016e2e189b2c9cd0017f69f5ee3f53885cba056cbe2215671482f2" + + "2cd2be5b6337ccaf6085e8966b6b8008a86ebe009c6b9570fce41812b11d" + + "1bb2c11331673334e625c9625b58827576f2fef23f3b16dfaa4283e3326d" + + "9b8e4326f0bd0e1fa1a73aaf2cc88ae6ea3ff9a5d2258f92aa1a08129cfe" + + "ac4ac7c3eb8094ab8716d12349e7a4bbc791dfe679343f414aa73a26d2ea" + + "6f46e33873e6e5d491ae0b789e78a5ef96e373d8f79565e905bf4f5cff52" + + "a7f9cf08afa74d0999c071a3527aa53bd79b015403e3b662b05a279c3026" + + "8eb64d56a117177a7b95a107ac5331b6d62e0fcd4174ecf101b2fd45bffc" + + "31e146423136431eb9aa055f847f91b18bae0fd754c3fdf064086ad39c8e" + + "ea7934ec033d73e01b36d46811c75970b0877cc0dc6e45ca36ce43267702" + + "a9700de8b857544442c3fbac1b632608c2d2231f7f930b7c6f08549a2b4e" + + "5dce9fa53ed2985bd102dbf183ce3052483863f1b1fbed23d33e92b5278d" + + "d04273d79d236871ba595e0752a6964dbf7c4e6f742205c0538016d8604e" + + "97314f894e4863d8edf9e5c2d90eb20bf6694cbd4b01c9cbdd06bf3a02eb" + + "1cdd308b0d4a1460f9d5644f4344a1ed0203010001a38201253082012130" + + "1d0603551d0e04160414b5760c3011cec792424d4cc75c2cc8a90ce80b64" + + "301f0603551d23041830168014e59d5930824758ccacfa085436867b3ab5" + + "044df0300e0603551d0f0101ff040403020186301d0603551d2504163014" + + "06082b0601050507030106082b0601050507030230120603551d130101ff" + + "040830060101ff020100303406082b060105050701010428302630240608" + + "2b060105050730018618687474703a2f2f6f6373702e6469676963657274" + + "2e636f6d303a0603551d1f04333031302fa02da02b8629687474703a2f2f" + + "63726c332e64696769636572742e636f6d2f4f6d6e69726f6f7432303235" + + "2e63726c302a0603551d20042330213008060667810c0102013008060667" + + "810c010202300b06092b0601040182372a01300d06092a864886f70d0101" + + "0b050003820101009f2bbe92675bda7b8aade8ff9d4d050eedb60d1541d1" + + "e615dc0360f9f422569c48f99daeda2b3ca8c0abd0ba95b8c8c1fd7c6371" + + "b6c87a889b3046a38e7d9602e3f82204efe036c06fc2bf2e0d6eedd67628" + + "0d81873e9be7a7108cda661f4051eae7bebf4e6798bb5459636f42e30f31" + + "601964000f260c97d184c0a67a193b70de4526dc96463d9c663fe13a8238" + + "e53603042857a4e94b64a218886d60898d7abe10918bace63f3130bfeb64" + + "d79e8de9c192566e388d343faecd6c6b4252623cd46989e0a057590b839f" + + "c6722442f5080384ce1663f334f105763719b206de133e137061d304f2b8" + + "476f05e38a88302b47455e7954c5f9ddebfa3f785175d25b").HexToByteArray(); internal static readonly byte[] MicrosoftDotComRootBytes = ( - "308204D3308203BBA003020102021018DAD19E267DE8BB4A2158CDCC6B3B4A30" + - "0D06092A864886F70D01010505003081CA310B30090603550406130255533117" + - "3015060355040A130E566572695369676E2C20496E632E311F301D060355040B" + - "1316566572695369676E205472757374204E6574776F726B313A303806035504" + - "0B1331286329203230303620566572695369676E2C20496E632E202D20466F72" + - "20617574686F72697A656420757365206F6E6C79314530430603550403133C56" + - "6572695369676E20436C6173732033205075626C6963205072696D6172792043" + - "657274696669636174696F6E20417574686F72697479202D204735301E170D30" + - "36313130383030303030305A170D3336303731363233353935395A3081CA310B" + - "300906035504061302555331173015060355040A130E566572695369676E2C20" + - "496E632E311F301D060355040B1316566572695369676E205472757374204E65" + - "74776F726B313A3038060355040B133128632920323030362056657269536967" + - "6E2C20496E632E202D20466F7220617574686F72697A656420757365206F6E6C" + - "79314530430603550403133C566572695369676E20436C617373203320507562" + - "6C6963205072696D6172792043657274696669636174696F6E20417574686F72" + - "697479202D20473530820122300D06092A864886F70D01010105000382010F00" + - "3082010A0282010100AF240808297A359E600CAAE74B3B4EDC7CBC3C451CBB2B" + - "E0FE2902F95708A364851527F5F1ADC831895D22E82AAAA642B38FF8B955B7B1" + - "B74BB3FE8F7E0757ECEF43DB66621561CF600DA4D8DEF8E0C362083D5413EB49" + - "CA59548526E52B8F1B9FEBF5A191C23349D843636A524BD28FE870514DD18969" + - "7BC770F6B3DC1274DB7B5D4B56D396BF1577A1B0F4A225F2AF1C926718E5F406" + - "04EF90B9E400E4DD3AB519FF02BAF43CEEE08BEB378BECF4D7ACF2F6F03DAFDD" + - "759133191D1C40CB7424192193D914FEAC2A52C78FD50449E48D6347883C6983" + - "CBFE47BD2B7E4FC595AE0E9DD4D143C06773E314087EE53F9F73B8330ACF5D3F" + - "3487968AEE53E825150203010001A381B23081AF300F0603551D130101FF0405" + - "30030101FF300E0603551D0F0101FF040403020106306D06082B060105050701" + - "0C0461305FA15DA05B3059305730551609696D6167652F6769663021301F3007" + - "06052B0E03021A04148FE5D31A86AC8D8E6BC3CF806AD448182C7B192E302516" + - "23687474703A2F2F6C6F676F2E766572697369676E2E636F6D2F76736C6F676F" + - "2E676966301D0603551D0E041604147FD365A7C2DDECBBF03009F34339FA02AF" + - "333133300D06092A864886F70D0101050500038201010093244A305F62CFD81A" + - "982F3DEADC992DBD77F6A5792238ECC4A7A07812AD620E457064C5E797662D98" + - "097E5FAFD6CC2865F201AA081A47DEF9F97C925A0869200DD93E6D6E3C0D6ED8" + - "E606914018B9F8C1EDDFDB41AAE09620C9CD64153881C994EEA284290B136F8E" + - "DB0CDD2502DBA48B1944D2417A05694A584F60CA7E826A0B02AA251739B5DB7F" + - "E784652A958ABD86DE5E8116832D10CCDEFDA8822A6D281F0D0BC4E5E71A2619" + - "E1F4116F10B595FCE7420532DBCE9D515E28B69E85D35BEFA57D4540728EB70E" + - "6B0E06FB33354871B89D278BC4655F0D86769C447AF6955CF65D320833A454B6" + - "183F685CF2424A853854835FD1E82CF2AC11D6A8ED636A").HexToByteArray(); + "308203773082025fa0030201020204020000b9300d06092a864886f70d01" + + "01050500305a310b300906035504061302494531123010060355040a1309" + + "42616c74696d6f726531133011060355040b130a43796265725472757374" + + "312230200603550403131942616c74696d6f726520437962657254727573" + + "7420526f6f74301e170d3030303531323138343630305a170d3235303531" + + "323233353930305a305a310b300906035504061302494531123010060355" + + "040a130942616c74696d6f726531133011060355040b130a437962657254" + + "72757374312230200603550403131942616c74696d6f7265204379626572" + + "547275737420526f6f7430820122300d06092a864886f70d010101050003" + + "82010f003082010a0282010100a304bb22ab983d57e826729ab579d429e2" + + "e1e89580b1b0e35b8e2b299a64dfa15dedb009056ddb282ece62a262feb4" + + "88da12eb38eb219dc0412b01527b8877d31c8fc7bab988b56a09e773e811" + + "40a7d1ccca628d2de58f0ba650d2a850c328eaf5ab25878a9a961ca967b8" + + "3f0cd5f7f952132fc21bd57070f08fc012ca06cb9ae1d9ca337a77d6f8ec" + + "b9f16844424813d2c0c2a4ae5e60feb6a605fcb4dd075902d459189863f5" + + "a563e0900c7d5db2067af385eaebd403ae5e843e5fff15ed69bcf9393672" + + "75cf77524df3c9902cb93de5c923533f1f2498215c079929bdc63aece76e" + + "863a6b97746333bd681831f0788d76bffc9e8e5d2a86a74d90dc271a3902" + + "03010001a3453043301d0603551d0e04160414e59d5930824758ccacfa08" + + "5436867b3ab5044df030120603551d130101ff040830060101ff02010330" + + "0e0603551d0f0101ff040403020106300d06092a864886f70d0101050500" + + "0382010100850c5d8ee46f51684205a0ddbb4f27258403bdf764fd2dd730" + + "e3a41017ebda2929b6793f76f6191323b8100af958a4d46170bd04616a12" + + "8a17d50abdc5bc307cd6e90c258d86404feccca37e38c637114feddd6831" + + "8e4cd2b30174eebe755e07481a7f70ff165c84c07985b805fd7fbe6511a3" + + "0fc002b4f852373904d5a9317a18bfa02af41299f7a34582e33c5ef59d9e" + + "b5c89e7c2ec8a49e4e08144b6dfd706d6b1a63bd64e61fb7cef0f29f2ebb" + + "1bb7f250887392c2e2e3168d9a3202ab8e18dde91011ee7e35ab90af3e30" + + "947ad0333da7650ff5fc8e9e62cf47442c015dbb1db532d247d2382ed0fe" + + "81dc326a1eb5ee3cd5fce7811d19c32442ea6339a9").HexToByteArray(); internal static readonly byte[] Rsa384CertificatePemBytes = ByteUtils.AsciiBytes( @"-----BEGIN CERTIFICATE----- From b80e67a13e65faa5c7ebc90a232e3207aa9de935 Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Thu, 18 Feb 2021 11:04:40 -0500 Subject: [PATCH 2/2] Fix typo in method name. --- .../tests/ChainTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs b/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs index 9cdf3b85eb71d..11043ae081f26 100644 --- a/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs +++ b/src/libraries/System.Security.Cryptography.X509Certificates/tests/ChainTests.cs @@ -368,7 +368,7 @@ public static void Invalidx509ChainTrustMode(int trustMode) } } - public static IEnumerable VerifyExpressionData() + public static IEnumerable VerifyExpirationData() { // The test will be using the chain for TestData.MicrosoftDotComSslCertBytes // The leaf cert (microsoft.com) is valid from 2020-08-28 22:17:02Z to 2021-08-28 22:17:02Z @@ -426,7 +426,7 @@ public static IEnumerable VerifyExpressionData() } [Theory] - [MemberData(nameof(VerifyExpressionData))] + [MemberData(nameof(VerifyExpirationData))] public static void VerifyExpiration_LocalTime(DateTime verificationTime, bool shouldBeValid) { using (var microsoftDotCom = new X509Certificate2(TestData.MicrosoftDotComSslCertBytes))