| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |