Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: net/base/x509_certificate_unittest.cc

Issue 9699043: net: fallback to online revocation checks for EV status when CRLSet has expired. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/file_path.h" 5 #include "base/file_path.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 #include "base/sha1.h" 9 #include "base/sha1.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 ASSERT_EQ(3U, certs.size()); 358 ASSERT_EQ(3U, certs.size());
359 359
360 X509Certificate::OSCertHandles intermediates; 360 X509Certificate::OSCertHandles intermediates;
361 intermediates.push_back(certs[1]->os_cert_handle()); 361 intermediates.push_back(certs[1]->os_cert_handle());
362 intermediates.push_back(certs[2]->os_cert_handle()); 362 intermediates.push_back(certs[2]->os_cert_handle());
363 363
364 scoped_refptr<X509Certificate> comodo_chain = 364 scoped_refptr<X509Certificate> comodo_chain =
365 X509Certificate::CreateFromHandle(certs[0]->os_cert_handle(), 365 X509Certificate::CreateFromHandle(certs[0]->os_cert_handle(),
366 intermediates); 366 intermediates);
367 367
368 scoped_ptr<CRLSet> crl_set(CRLSet::EmptyCRLSetForTesting());
368 CertVerifyResult verify_result; 369 CertVerifyResult verify_result;
369 int flags = X509Certificate::VERIFY_EV_CERT; 370 int flags = X509Certificate::VERIFY_EV_CERT;
370 int error = comodo_chain->Verify( 371 int error = comodo_chain->Verify(
371 "comodo.com", flags, NULL, &verify_result); 372 "comodo.com", flags, crl_set.get(), &verify_result);
372 EXPECT_EQ(OK, error); 373 EXPECT_EQ(OK, error);
373 EXPECT_TRUE(verify_result.cert_status & CERT_STATUS_IS_EV); 374 EXPECT_TRUE(verify_result.cert_status & CERT_STATUS_IS_EV);
374 } 375 }
375 376
376 // Test that all desired AttributeAndValue pairs can be extracted when only 377 // Test that all desired AttributeAndValue pairs can be extracted when only
377 // a single RelativeDistinguishedName is present. "Normally" there is only 378 // a single RelativeDistinguishedName is present. "Normally" there is only
378 // one AVA per RDN, but some CAs place all AVAs within a single RDN. 379 // one AVA per RDN, but some CAs place all AVAs within a single RDN.
379 // This is a regression test for http://crbug.com/101009 380 // This is a regression test for http://crbug.com/101009
380 TEST(X509CertificateTest, MultivalueRDN) { 381 TEST(X509CertificateTest, MultivalueRDN) {
381 FilePath certs_dir = GetTestCertsDirectory(); 382 FilePath certs_dir = GetTestCertsDirectory();
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2000 #define MAYBE_VerifyMixed DISABLED_VerifyMixed 2001 #define MAYBE_VerifyMixed DISABLED_VerifyMixed
2001 #else 2002 #else
2002 #define MAYBE_VerifyMixed VerifyMixed 2003 #define MAYBE_VerifyMixed VerifyMixed
2003 #endif 2004 #endif
2004 WRAPPED_INSTANTIATE_TEST_CASE_P( 2005 WRAPPED_INSTANTIATE_TEST_CASE_P(
2005 MAYBE_VerifyMixed, 2006 MAYBE_VerifyMixed,
2006 X509CertificateWeakDigestTest, 2007 X509CertificateWeakDigestTest,
2007 testing::ValuesIn(kVerifyMixedTestData)); 2008 testing::ValuesIn(kVerifyMixedTestData));
2008 2009
2009 } // namespace net 2010 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698