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

Side by Side Diff: net/tools/cert_verify_tool/verify_using_path_builder.cc

Issue 2329593002: Add optional context for certificate errors. (Closed)
Patch Set: Address Matt's comments Created 4 years, 3 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/net.gypi ('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 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/tools/cert_verify_tool/verify_using_path_builder.h" 5 #include "net/tools/cert_verify_tool/verify_using_path_builder.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 std::string trust_anchor_cert_fingerprint = "<no cert>"; 139 std::string trust_anchor_cert_fingerprint = "<no cert>";
140 if (trust_anchor->cert()) { 140 if (trust_anchor->cert()) {
141 trust_anchor_cert_fingerprint = 141 trust_anchor_cert_fingerprint =
142 FingerPrintParsedCertificate(trust_anchor->cert().get()); 142 FingerPrintParsedCertificate(trust_anchor->cert().get());
143 } 143 }
144 std::cout << " " << trust_anchor_cert_fingerprint << " " 144 std::cout << " " << trust_anchor_cert_fingerprint << " "
145 << SubjectFromTrustAnchor(trust_anchor.get()) << "\n"; 145 << SubjectFromTrustAnchor(trust_anchor.get()) << "\n";
146 } 146 }
147 147
148 // Print the errors. 148 // Print the errors.
149 if (!result_path->errors.errors().empty()) { 149 if (!result_path->errors.empty()) {
150 std::cout << "Errors:\n"; 150 std::cout << "Errors:\n";
151 std::cout << result_path->errors.ToDebugString() << "\n"; 151 std::cout << result_path->errors.ToDebugString() << "\n";
152 } 152 }
153 } 153 }
154 154
155 } // namespace 155 } // namespace
156 156
157 // Verifies |target_der_cert| using CertPathBuilder. 157 // Verifies |target_der_cert| using CertPathBuilder.
158 bool VerifyUsingPathBuilder( 158 bool VerifyUsingPathBuilder(
159 const CertInput& target_der_cert, 159 const CertInput& target_der_cert,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 if (!DumpParsedCertificateChain( 260 if (!DumpParsedCertificateChain(
261 dump_prefix_path.AddExtension( 261 dump_prefix_path.AddExtension(
262 FILE_PATH_LITERAL(".CertPathBuilder.pem")), 262 FILE_PATH_LITERAL(".CertPathBuilder.pem")),
263 result.paths[result.best_result_index]->path)) { 263 result.paths[result.best_result_index]->path)) {
264 return false; 264 return false;
265 } 265 }
266 } 266 }
267 267
268 return result.HasValidPath(); 268 return result.HasValidPath();
269 } 269 }
OLDNEW
« no previous file with comments | « net/net.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698