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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 2108833005: Adds domain names for all qualified CT logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Slightly more documentation about DNS endpoints for logs Created 4 years, 5 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 | « no previous file | chrome/common/chrome_switches.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 // Add logs from command line 541 // Add logs from command line
542 if (command_line.HasSwitch(switches::kCertificateTransparencyLog)) { 542 if (command_line.HasSwitch(switches::kCertificateTransparencyLog)) {
543 std::string switch_value = command_line.GetSwitchValueASCII( 543 std::string switch_value = command_line.GetSwitchValueASCII(
544 switches::kCertificateTransparencyLog); 544 switches::kCertificateTransparencyLog);
545 for (const base::StringPiece& curr_log : base::SplitStringPiece( 545 for (const base::StringPiece& curr_log : base::SplitStringPiece(
546 switch_value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { 546 switch_value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
547 std::vector<std::string> log_metadata = base::SplitString( 547 std::vector<std::string> log_metadata = base::SplitString(
548 curr_log, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 548 curr_log, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
549 CHECK_GE(log_metadata.size(), 3u) 549 CHECK_GE(log_metadata.size(), 3u)
550 << "CT log metadata missing: Switch format is " 550 << "CT log metadata missing: Switch format is "
551 << "'description:base64_key:url_without_schema'."; 551 << "'description:base64_key:url_without_schema[:dns_domain]'.";
552 std::string log_description(log_metadata[0]); 552 std::string log_description(log_metadata[0]);
553 std::string log_url(std::string("https://") + log_metadata[2]); 553 std::string log_url(std::string("https://") + log_metadata[2]);
554 std::string log_dns_domain;
555 if (log_metadata.size() >= 4)
556 log_dns_domain = log_metadata[3];
554 std::string ct_public_key_data; 557 std::string ct_public_key_data;
555 CHECK(base::Base64Decode(log_metadata[1], &ct_public_key_data)) 558 CHECK(base::Base64Decode(log_metadata[1], &ct_public_key_data))
556 << "Unable to decode CT public key."; 559 << "Unable to decode CT public key.";
557 scoped_refptr<const net::CTLogVerifier> external_log_verifier( 560 scoped_refptr<const net::CTLogVerifier> external_log_verifier(
558 net::CTLogVerifier::Create(ct_public_key_data, log_description, 561 net::CTLogVerifier::Create(ct_public_key_data, log_description,
559 log_url)); 562 log_url, log_dns_domain));
560 CHECK(external_log_verifier) << "Unable to parse CT public key."; 563 CHECK(external_log_verifier) << "Unable to parse CT public key.";
561 VLOG(1) << "Adding log with description " << log_description; 564 VLOG(1) << "Adding log with description " << log_description;
562 ct_logs.push_back(external_log_verifier); 565 ct_logs.push_back(external_log_verifier);
563 } 566 }
564 } 567 }
565 568
566 globals_->ct_logs.assign(ct_logs.begin(), ct_logs.end()); 569 globals_->ct_logs.assign(ct_logs.begin(), ct_logs.end());
567 570
568 net::MultiLogCTVerifier* ct_verifier = new net::MultiLogCTVerifier(); 571 net::MultiLogCTVerifier* ct_verifier = new net::MultiLogCTVerifier();
569 globals_->cert_transparency_verifier.reset(ct_verifier); 572 globals_->cert_transparency_verifier.reset(ct_verifier);
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the 992 // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the
990 // system URLRequestContext too. There's no reason this should be tied to a 993 // system URLRequestContext too. There's no reason this should be tied to a
991 // profile. 994 // profile.
992 return context; 995 return context;
993 } 996 }
994 997
995 const metrics::UpdateUsagePrefCallbackType& 998 const metrics::UpdateUsagePrefCallbackType&
996 IOThread::GetMetricsDataUseForwarder() { 999 IOThread::GetMetricsDataUseForwarder() {
997 return metrics_data_use_forwarder_; 1000 return metrics_data_use_forwarder_;
998 } 1001 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_switches.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698