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

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

Issue 6993027: net: followup to codereview for cl/7096014 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 6 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
« no previous file with comments | « net/base/asn1_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 scoped_refptr<X509Certificate> cert = 581 scoped_refptr<X509Certificate> cert =
582 ImportCertFromFile(certs_dir, "nist.der"); 582 ImportCertFromFile(certs_dir, "nist.der");
583 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert); 583 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert);
584 584
585 std::string derBytes; 585 std::string derBytes;
586 EXPECT_TRUE(cert->GetDEREncoded(&derBytes)); 586 EXPECT_TRUE(cert->GetDEREncoded(&derBytes));
587 587
588 std::vector<base::StringPiece> crl_urls; 588 std::vector<base::StringPiece> crl_urls;
589 EXPECT_TRUE(asn1::ExtractCRLURLsFromDERCert(derBytes, &crl_urls)); 589 EXPECT_TRUE(asn1::ExtractCRLURLsFromDERCert(derBytes, &crl_urls));
590 590
591 EXPECT_EQ(crl_urls.size(), 1u); 591 EXPECT_EQ(1u, crl_urls.size());
592 if (crl_urls.size() > 0) { 592 if (crl_urls.size() > 0) {
593 EXPECT_EQ(crl_urls[0].as_string(), 593 EXPECT_EQ("http://SVRSecure-G3-crl.verisign.com/SVRSecureG3.crl",
594 "http://SVRSecure-G3-crl.verisign.com/SVRSecureG3.crl"); 594 crl_urls[0].as_string());
595 } 595 }
596 } 596 }
597 597
598 TEST(X509CertificateTest, PublicKeyHashes) { 598 TEST(X509CertificateTest, PublicKeyHashes) {
599 FilePath certs_dir = GetTestCertsDirectory(); 599 FilePath certs_dir = GetTestCertsDirectory();
600 // This is going to blow up in Feb 2012. Sorry! Disable and file a bug 600 // This is going to blow up in Feb 2012. Sorry! Disable and file a bug
601 // against agl. Also see TestKnownRoot in this file. 601 // against agl. Also see TestKnownRoot in this file.
602 scoped_refptr<X509Certificate> cert = 602 scoped_refptr<X509Certificate> cert =
603 ImportCertFromFile(certs_dir, "nist.der"); 603 ImportCertFromFile(certs_dir, "nist.der");
604 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert); 604 ASSERT_NE(static_cast<X509Certificate*>(NULL), cert);
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 EXPECT_EQ(test_data.expected, 1168 EXPECT_EQ(test_data.expected,
1169 X509Certificate::VerifyHostname(test_data.hostname, cert_names)) 1169 X509Certificate::VerifyHostname(test_data.hostname, cert_names))
1170 << "Host [" << test_data.hostname 1170 << "Host [" << test_data.hostname
1171 << "], cert name [" << test_data.cert_names << "]"; 1171 << "], cert name [" << test_data.cert_names << "]";
1172 } 1172 }
1173 1173
1174 INSTANTIATE_TEST_CASE_P(, X509CertificateNameVerifyTest, 1174 INSTANTIATE_TEST_CASE_P(, X509CertificateNameVerifyTest,
1175 testing::ValuesIn(kNameVerifyTestData)); 1175 testing::ValuesIn(kNameVerifyTestData));
1176 1176
1177 } // namespace net 1177 } // namespace net
OLDNEW
« no previous file with comments | « net/base/asn1_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698