OLD | NEW |
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 // This utility can dump the contents of CRL set, optionally augmented with a | 5 // This utility can dump the contents of CRL set, optionally augmented with a |
6 // delta CRL set. | 6 // delta CRL set. |
7 | 7 |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/at_exit.h" | 14 #include "base/at_exit.h" |
15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "net/cert/crl_set.h" | 18 #include "net/cert/crl_set.h" |
19 | 19 |
20 static int Usage(const char* argv0) { | 20 static int Usage(const char* argv0) { |
21 fprintf(stderr, "Usage: %s <crl-set file> [<delta file>]" | 21 fprintf(stderr, |
22 " [<resulting output file>]\n", argv0); | 22 "Usage: %s <crl-set file> [<delta file>]" |
| 23 " [<resulting output file>]\n", |
| 24 argv0); |
23 return 1; | 25 return 1; |
24 } | 26 } |
25 | 27 |
26 int main(int argc, char** argv) { | 28 int main(int argc, char** argv) { |
27 base::AtExitManager at_exit_manager; | 29 base::AtExitManager at_exit_manager; |
28 | 30 |
29 base::FilePath crl_set_filename, delta_filename, output_filename; | 31 base::FilePath crl_set_filename, delta_filename, output_filename; |
30 | 32 |
31 if (argc < 2 || argc > 4) | 33 if (argc < 2 || argc > 4) |
32 return Usage(argv[0]); | 34 return Usage(argv[0]); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 fprintf(stderr, "Failed to write resulting CRL set\n"); | 68 fprintf(stderr, "Failed to write resulting CRL set\n"); |
67 return 1; | 69 return 1; |
68 } | 70 } |
69 } | 71 } |
70 | 72 |
71 const net::CRLSet::CRLList& crls = final_crl_set->crls(); | 73 const net::CRLSet::CRLList& crls = final_crl_set->crls(); |
72 for (net::CRLSet::CRLList::const_iterator i = crls.begin(); i != crls.end(); | 74 for (net::CRLSet::CRLList::const_iterator i = crls.begin(); i != crls.end(); |
73 i++) { | 75 i++) { |
74 printf("%s\n", base::HexEncode(i->first.data(), i->first.size()).c_str()); | 76 printf("%s\n", base::HexEncode(i->first.data(), i->first.size()).c_str()); |
75 for (std::vector<std::string>::const_iterator j = i->second.begin(); | 77 for (std::vector<std::string>::const_iterator j = i->second.begin(); |
76 j != i->second.end(); j++) { | 78 j != i->second.end(); |
| 79 j++) { |
77 printf(" %s\n", base::HexEncode(j->data(), j->size()).c_str()); | 80 printf(" %s\n", base::HexEncode(j->data(), j->size()).c_str()); |
78 } | 81 } |
79 } | 82 } |
80 | 83 |
81 return 0; | 84 return 0; |
82 } | 85 } |
OLD | NEW |