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

Side by Side Diff: net/cert/internal/path_builder_unittest.cc

Issue 2735733003: Disable commonName matching for certificates (Closed)
Patch Set: Created 3 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
« no previous file with comments | « net/cert/cert_verify_proc_unittest.cc ('k') | net/cert/x509_certificate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "net/cert/internal/path_builder.h" 5 #include "net/cert/internal/path_builder.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "net/cert/internal/cert_issuer_source_static.h" 10 #include "net/cert/internal/cert_issuer_source_static.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 ASSERT_TRUE(ReadTestCert("multi-root-D-by-D.pem", &d_by_d_)); 127 ASSERT_TRUE(ReadTestCert("multi-root-D-by-D.pem", &d_by_d_));
128 ASSERT_TRUE(ReadTestCert("multi-root-E-by-E.pem", &e_by_e_)); 128 ASSERT_TRUE(ReadTestCert("multi-root-E-by-E.pem", &e_by_e_));
129 ASSERT_TRUE(ReadTestCert("multi-root-F-by-E.pem", &f_by_e_)); 129 ASSERT_TRUE(ReadTestCert("multi-root-F-by-E.pem", &f_by_e_));
130 } 130 }
131 131
132 protected: 132 protected:
133 scoped_refptr<ParsedCertificate> a_by_b_, b_by_c_, b_by_f_, c_by_d_, c_by_e_, 133 scoped_refptr<ParsedCertificate> a_by_b_, b_by_c_, b_by_f_, c_by_d_, c_by_e_,
134 d_by_d_, e_by_e_, f_by_e_; 134 d_by_d_, e_by_e_, f_by_e_;
135 135
136 SimpleSignaturePolicy signature_policy_; 136 SimpleSignaturePolicy signature_policy_;
137 der::GeneralizedTime time_ = {2016, 4, 11, 0, 0, 0}; 137 der::GeneralizedTime time_ = {2017, 3, 1, 0, 0, 0};
138 }; 138 };
139 139
140 void AddTrustedCertificate(scoped_refptr<ParsedCertificate> cert, 140 void AddTrustedCertificate(scoped_refptr<ParsedCertificate> cert,
141 TrustStoreInMemory* trust_store) { 141 TrustStoreInMemory* trust_store) {
142 ASSERT_TRUE(cert.get()); 142 ASSERT_TRUE(cert.get());
143 scoped_refptr<TrustAnchor> anchor = 143 scoped_refptr<TrustAnchor> anchor =
144 TrustAnchor::CreateFromCertificateNoConstraints(std::move(cert)); 144 TrustAnchor::CreateFromCertificateNoConstraints(std::move(cert));
145 ASSERT_TRUE(anchor.get()); 145 ASSERT_TRUE(anchor.get());
146 trust_store->AddTrustAnchor(std::move(anchor)); 146 trust_store->AddTrustAnchor(std::move(anchor));
147 } 147 }
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 const auto& path1 = result.paths[1]->path; 1097 const auto& path1 = result.paths[1]->path;
1098 ASSERT_EQ(2U, path1.certs.size()); 1098 ASSERT_EQ(2U, path1.certs.size());
1099 EXPECT_EQ(target_, path1.certs[0]); 1099 EXPECT_EQ(target_, path1.certs[0]);
1100 EXPECT_EQ(newintermediate_, path1.certs[1]); 1100 EXPECT_EQ(newintermediate_, path1.certs[1]);
1101 EXPECT_EQ(newroot_, path1.trust_anchor->cert()); 1101 EXPECT_EQ(newroot_, path1.trust_anchor->cert());
1102 } 1102 }
1103 1103
1104 } // namespace 1104 } // namespace
1105 1105
1106 } // namespace net 1106 } // namespace net
OLDNEW
« no previous file with comments | « net/cert/cert_verify_proc_unittest.cc ('k') | net/cert/x509_certificate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698