| 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 <iostream> | 5 #include <iostream> |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // TODO(mattm): allow <certs path> to be a directory containing DER/PEM files? | 62 // TODO(mattm): allow <certs path> to be a directory containing DER/PEM files? |
| 63 // TODO(mattm): allow target to specify an HTTPS URL to check the cert of? | 63 // TODO(mattm): allow target to specify an HTTPS URL to check the cert of? |
| 64 // TODO(mattm): allow target to be a verify_certificate_chain_unittest PEM | 64 // TODO(mattm): allow target to be a verify_certificate_chain_unittest PEM |
| 65 // file? | 65 // file? |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace | 68 } // namespace |
| 69 | 69 |
| 70 int main(int argc, char** argv) { | 70 int main(int argc, char** argv) { |
| 71 base::AtExitManager at_exit_manager; | 71 base::AtExitManager at_exit_manager; |
| 72 // TODO(eroman): Is this needed? |
| 72 base::MessageLoopForIO message_loop; | 73 base::MessageLoopForIO message_loop; |
| 73 if (!base::CommandLine::Init(argc, argv)) { | 74 if (!base::CommandLine::Init(argc, argv)) { |
| 74 std::cerr << "ERROR in CommandLine::Init\n"; | 75 std::cerr << "ERROR in CommandLine::Init\n"; |
| 75 return 1; | 76 return 1; |
| 76 } | 77 } |
| 77 base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); | 78 base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); |
| 78 logging::LoggingSettings settings; | 79 logging::LoggingSettings settings; |
| 79 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; | 80 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; |
| 80 logging::InitLogging(settings); | 81 logging::InitLogging(settings); |
| 81 | 82 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 std::cerr | 145 std::cerr |
| 145 << "WARNING: --hostname is not yet verified with CertPathBuilder\n"; | 146 << "WARNING: --hostname is not yet verified with CertPathBuilder\n"; |
| 146 } | 147 } |
| 147 | 148 |
| 148 bool path_builder_ok = | 149 bool path_builder_ok = |
| 149 VerifyUsingPathBuilder(target_der_cert, intermediate_der_certs, | 150 VerifyUsingPathBuilder(target_der_cert, intermediate_der_certs, |
| 150 root_der_certs, verify_time, dump_prefix_path); | 151 root_der_certs, verify_time, dump_prefix_path); |
| 151 | 152 |
| 152 return (cert_verify_proc_ok && path_builder_ok) ? 0 : 1; | 153 return (cert_verify_proc_ok && path_builder_ok) ? 0 : 1; |
| 153 } | 154 } |
| OLD | NEW |