summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs/command_line_pref_store.cc
diff options
context:
space:
mode:
authorrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-23 04:56:43 +0000
committerrsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-23 04:56:43 +0000
commit373e65ed203d0acd9c1bf20fb2c91dabe50b7bc4 (patch)
treeb96deb8582be926cc69df462a39f7018b0f416e8 /chrome/browser/prefs/command_line_pref_store.cc
parentad4d54e931fe3b556cdd9e859a8654e4e6caed68 (diff)
downloadchromium_src-373e65ed203d0acd9c1bf20fb2c91dabe50b7bc4.zip
chromium_src-373e65ed203d0acd9c1bf20fb2c91dabe50b7bc4.tar.gz
chromium_src-373e65ed203d0acd9c1bf20fb2c91dabe50b7bc4.tar.bz2
Add a preference and command-line option to disable SSL/TLS cipher suites
R=battre BUG=58831 TEST=unit_tests --gtest_filter=CommandLinePrefStoreTest.DisableSSLCipherSuites:SSLConfigServiceManagerPrefTest.* Review URL: http://codereview.chromium.org/7462008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prefs/command_line_pref_store.cc')
-rw-r--r--chrome/browser/prefs/command_line_pref_store.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/prefs/command_line_pref_store.cc b/chrome/browser/prefs/command_line_pref_store.cc
index a475c45..021be74 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);
+ }
+}