From cafe181ce22d75af581b96e590ad2b55fd5640d9 Mon Sep 17 00:00:00 2001 From: "wtc@chromium.org" Date: Sat, 28 Jan 2012 08:38:11 +0000 Subject: Allow X509CertificateTest.IntermediateCARequireExplicitPolicy to pass after the certificate expires. R=rsleevi@chromium.org BUG=111742 TEST=net_unittests should pass Review URL: http://codereview.chromium.org/9232067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119592 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/x509_certificate_unittest.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'net') diff --git a/net/base/x509_certificate_unittest.cc b/net/base/x509_certificate_unittest.cc index cb7a1c7..b7df5da 100644 --- a/net/base/x509_certificate_unittest.cc +++ b/net/base/x509_certificate_unittest.cc @@ -548,7 +548,9 @@ TEST(X509CertificateTest, CAFingerprints) { } // A regression test for http://crbug.com/31497. -// This certificate will expire on 2012-04-08. +// This certificate will expire on 2012-04-08. The test will still +// pass if error == ERR_CERT_DATE_INVALID. TODO(wtc): generate test +// certificates for this unit test. http://crbug.com/111742 TEST(X509CertificateTest, IntermediateCARequireExplicitPolicy) { FilePath certs_dir = GetTestCertsDirectory(); @@ -576,8 +578,12 @@ TEST(X509CertificateTest, IntermediateCARequireExplicitPolicy) { CertVerifyResult verify_result; int error = cert_chain->Verify("www.us.army.mil", flags, NULL, &verify_result); - EXPECT_EQ(OK, error); - EXPECT_EQ(0U, verify_result.cert_status); + if (error == OK) { + EXPECT_EQ(0U, verify_result.cert_status); + } else { + EXPECT_EQ(ERR_CERT_DATE_INVALID, error); + EXPECT_EQ(CERT_STATUS_DATE_INVALID, verify_result.cert_status); + } root_certs->Clear(); } -- cgit v1.1