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

Unified Diff: chrome/browser/net/ssl_config_service_manager_pref_unittest.cc

Issue 1139013002: Completely remove SSLv3 support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/net/ssl_config_service_manager_pref_unittest.cc
diff --git a/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc b/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc
index 770542ebb45534022a23f4e16afbb5913ff399db..e3afe0c8c8fa5f3d53c6339341a3a17b3fdc0240 100644
--- a/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc
+++ b/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc
@@ -173,8 +173,8 @@ TEST_F(SSLConfigServiceManagerPrefTest, CommandLinePrefs) {
scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore());
base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
- command_line.AppendSwitchASCII(switches::kSSLVersionMin, "tls1");
- command_line.AppendSwitchASCII(switches::kSSLVersionMax, "ssl3");
+ command_line.AppendSwitchASCII(switches::kSSLVersionMin, "tls1.1");
+ command_line.AppendSwitchASCII(switches::kSSLVersionMax, "tls1");
PrefServiceMockFactory factory;
factory.set_user_prefs(local_state_store);
@@ -193,8 +193,8 @@ TEST_F(SSLConfigServiceManagerPrefTest, CommandLinePrefs) {
SSLConfig ssl_config;
config_service->GetSSLConfig(&ssl_config);
// Command-line flags should be respected.
- EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_min);
- EXPECT_EQ(net::SSL_PROTOCOL_VERSION_SSL3, ssl_config.version_max);
+ EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1_1, ssl_config.version_min);
+ EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_max);
// Explicitly double-check the settings are not in the preference store.
const PrefService::Preference* version_min_pref =
@@ -212,3 +212,30 @@ TEST_F(SSLConfigServiceManagerPrefTest, CommandLinePrefs) {
EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax,
&version_max_str));
}
+
+// Tests that "ssl3" is not treated as a valid minimum version.
+TEST_F(SSLConfigServiceManagerPrefTest, NoSSL3) {
+ scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore());
+
+ base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
+ command_line.AppendSwitchASCII(switches::kSSLVersionMin, "ssl3");
+
+ PrefServiceMockFactory factory;
+ factory.set_user_prefs(local_state_store);
+ factory.SetCommandLine(&command_line);
+ scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple;
+ scoped_ptr<PrefService> local_state(factory.Create(registry.get()));
+
+ SSLConfigServiceManager::RegisterPrefs(registry.get());
+
+ scoped_ptr<SSLConfigServiceManager> config_manager(
+ SSLConfigServiceManager::CreateDefaultManager(local_state.get()));
+ ASSERT_TRUE(config_manager.get());
+ scoped_refptr<SSLConfigService> config_service(config_manager->Get());
+ ASSERT_TRUE(config_service.get());
+
+ SSLConfig ssl_config;
+ config_service->GetSSLConfig(&ssl_config);
+ // The command-line option must not have been honored.
+ EXPECT_LE(net::SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_min);
+}

Powered by Google App Engine
This is Rietveld 408576698