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

Unified Diff: chrome/browser/io_thread.cc

Issue 148283002: Certificate Transparency: Enhance the CT log flag for multiple logs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Using const reference Created 6 years, 11 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 | « no previous file | chrome/common/chrome_switches.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 314f9657909acd4e2339faa1387b7a7aab7f92ce..ee97bb952a9ecb0ffe8e207b3acd5038d995391a 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -562,19 +562,26 @@ void IOThread::InitAsync() {
if (command_line.HasSwitch(switches::kCertificateTransparencyLog)) {
std::string switch_value = command_line.GetSwitchValueASCII(
switches::kCertificateTransparencyLog);
- size_t delim_pos = switch_value.find(":");
- CHECK(delim_pos != std::string::npos)
- << "CT log description not provided (switch format"
- " is 'description:base64_key')";
- std::string log_description(switch_value.substr(0, delim_pos));
- std::string ct_public_key_data;
- CHECK(base::Base64Decode(
- switch_value.substr(delim_pos + 1),
- &ct_public_key_data)) << "Unable to decode CT public key.";
- scoped_ptr<net::CTLogVerifier> external_log_verifier(
- net::CTLogVerifier::Create(ct_public_key_data, log_description));
- CHECK(external_log_verifier) << "Unable to parse CT public key.";
- ct_verifier->AddLog(external_log_verifier.Pass());
+ std::vector<std::string> logs;
+ base::SplitString(switch_value, ',', &logs);
+ for (std::vector<std::string>::iterator it = logs.begin(); it != logs.end();
+ ++it) {
+ const std::string& curr_log = *it;
+ size_t delim_pos = curr_log.find(":");
+ CHECK(delim_pos != std::string::npos)
+ << "CT log description not provided (switch format"
+ " is 'description:base64_key')";
+ std::string log_description(curr_log.substr(0, delim_pos));
+ std::string ct_public_key_data;
+ CHECK(base::Base64Decode(curr_log.substr(delim_pos + 1),
+ &ct_public_key_data))
+ << "Unable to decode CT public key.";
+ scoped_ptr<net::CTLogVerifier> external_log_verifier(
+ net::CTLogVerifier::Create(ct_public_key_data, log_description));
+ CHECK(external_log_verifier) << "Unable to parse CT public key.";
+ VLOG(1) << "Adding log with description " << log_description;
+ ct_verifier->AddLog(external_log_verifier.Pass());
+ }
}
#else
if (command_line.HasSwitch(switches::kCertificateTransparencyLog)) {
« 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