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

Unified Diff: net/tools/crl_set_dump/crl_set_dump.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/crash_cache/crash_cache.cc ('k') | net/tools/disk_cache_memory_test/disk_cache_memory_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/crl_set_dump/crl_set_dump.cc
diff --git a/net/tools/crl_set_dump/crl_set_dump.cc b/net/tools/crl_set_dump/crl_set_dump.cc
deleted file mode 100644
index 72ed59c40821d90f6c9135bf39bf31a84e2d5ca3..0000000000000000000000000000000000000000
--- a/net/tools/crl_set_dump/crl_set_dump.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// This utility can dump the contents of CRL set, optionally augmented with a
-// delta CRL set.
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <string>
-
-#include "base/at_exit.h"
-#include "base/files/file_util.h"
-#include "base/memory/ref_counted.h"
-#include "base/strings/string_number_conversions.h"
-#include "net/cert/crl_set.h"
-#include "net/cert/crl_set_storage.h"
-
-static int Usage(const char* argv0) {
- fprintf(stderr, "Usage: %s <crl-set file> [<delta file>]"
- " [<resulting output file>]\n", argv0);
- return 1;
-}
-
-int main(int argc, char** argv) {
- base::AtExitManager at_exit_manager;
-
- base::FilePath crl_set_filename, delta_filename, output_filename;
-
- if (argc < 2 || argc > 4)
- return Usage(argv[0]);
-
- crl_set_filename = base::FilePath::FromUTF8Unsafe(argv[1]);
- if (argc >= 3)
- delta_filename = base::FilePath::FromUTF8Unsafe(argv[2]);
- if (argc >= 4)
- output_filename = base::FilePath::FromUTF8Unsafe(argv[3]);
-
- std::string crl_set_bytes, delta_bytes;
- if (!base::ReadFileToString(crl_set_filename, &crl_set_bytes))
- return 1;
- if (!delta_filename.empty() &&
- !base::ReadFileToString(delta_filename, &delta_bytes)) {
- return 1;
- }
-
- scoped_refptr<net::CRLSet> crl_set, final_crl_set;
- if (!net::CRLSetStorage::Parse(crl_set_bytes, &crl_set)) {
- fprintf(stderr, "Failed to parse CRLSet\n");
- return 1;
- }
-
- if (!delta_bytes.empty()) {
- if (!net::CRLSetStorage::ApplyDelta(
- crl_set.get(), delta_bytes, &final_crl_set)) {
- fprintf(stderr, "Failed to apply delta to CRLSet\n");
- return 1;
- }
- } else {
- final_crl_set = crl_set;
- }
-
- if (!output_filename.empty()) {
- const std::string out = net::CRLSetStorage::Serialize(final_crl_set.get());
- if (base::WriteFile(output_filename, out.data(), out.size()) == -1) {
- fprintf(stderr, "Failed to write resulting CRL set\n");
- return 1;
- }
- }
-
- const net::CRLSet::CRLList& crls = final_crl_set->crls();
- for (net::CRLSet::CRLList::const_iterator i = crls.begin(); i != crls.end();
- i++) {
- printf("%s\n", base::HexEncode(i->first.data(), i->first.size()).c_str());
- for (std::vector<std::string>::const_iterator j = i->second.begin();
- j != i->second.end(); j++) {
- printf(" %s\n", base::HexEncode(j->data(), j->size()).c_str());
- }
- }
-
- return 0;
-}
« no previous file with comments | « net/tools/crash_cache/crash_cache.cc ('k') | net/tools/disk_cache_memory_test/disk_cache_memory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698