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

Unified Diff: chrome/browser/prefs/command_line_pref_store.cc

Issue 7462008: Add a preference and command-line option to disable SSL/TLS cipher suites (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prefs/command_line_pref_store.cc
diff --git a/chrome/browser/prefs/command_line_pref_store.cc b/chrome/browser/prefs/command_line_pref_store.cc
index a475c45b39f1dca7c55b4d434772fa4cadaeca15..021be741cd0ee7747f9ff360971e68ae06790857 100644
--- a/chrome/browser/prefs/command_line_pref_store.cc
+++ b/chrome/browser/prefs/command_line_pref_store.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/prefs/command_line_pref_store.h"
#include "base/logging.h"
+#include "base/string_split.h"
#include "base/values.h"
#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/common/chrome_switches.h"
@@ -48,6 +49,7 @@ CommandLinePrefStore::CommandLinePrefStore(const CommandLine* command_line)
ApplySimpleSwitches();
ApplyProxyMode();
ValidateProxySwitches();
+ ApplySSLSwitches();
}
CommandLinePrefStore::~CommandLinePrefStore() {}
@@ -106,3 +108,18 @@ void CommandLinePrefStore::ApplyProxyMode() {
bypass_list));
}
}
+
+void CommandLinePrefStore::ApplySSLSwitches() {
+ if (command_line_->HasSwitch(switches::kCipherSuiteBlacklist)) {
+ std::string cipher_suites =
+ command_line_->GetSwitchValueASCII(switches::kCipherSuiteBlacklist);
+ std::vector<std::string> cipher_strings;
+ base::SplitString(cipher_suites, ',', &cipher_strings);
+ base::ListValue* list_value = new base::ListValue();
+ for (std::vector<std::string>::const_iterator it = cipher_strings.begin();
+ it != cipher_strings.end(); ++it) {
+ list_value->Append(base::Value::CreateStringValue(*it));
+ }
+ SetValue(prefs::kCipherSuiteBlacklist, list_value);
+ }
+}
battre 2011/07/20 11:16:30 Add a unit test to command_line_pref_store_unittes

Powered by Google App Engine
This is Rietveld 408576698