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

Side by Side Diff: chrome/browser/net/ssl_config_service_manager_pref_unittest.cc

Issue 88913003: Revert: "net: don't allow SSLv3 fallback for Google properties." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/net/ssl_config_service_manager_pref.cc ('k') | 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/net/ssl_config_service_manager.h" 5 #include "chrome/browser/net/ssl_config_service_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 ASSERT_EQ(2u, config.disabled_cipher_suites.size()); 143 ASSERT_EQ(2u, config.disabled_cipher_suites.size());
144 EXPECT_EQ(0x0004, config.disabled_cipher_suites[0]); 144 EXPECT_EQ(0x0004, config.disabled_cipher_suites[0]);
145 EXPECT_EQ(0x0005, config.disabled_cipher_suites[1]); 145 EXPECT_EQ(0x0005, config.disabled_cipher_suites[1]);
146 } 146 }
147 147
148 // Test that 148 // Test that
149 // * without command-line settings for minimum and maximum SSL versions, 149 // * without command-line settings for minimum and maximum SSL versions,
150 // SSL 3.0 ~ default_version_max() are enabled; 150 // SSL 3.0 ~ default_version_max() are enabled;
151 // * without --enable-unrestricted-ssl3-fallback, 151 // * without --enable-unrestricted-ssl3-fallback,
152 // |unrestricted_ssl3_fallback_enabled| is false. 152 // |unrestricted_ssl3_fallback_enabled| is false.
153 // TODO(thaidn): |unrestricted_ssl3_fallback_enabled| is true by default
154 // temporarily until we have fixed deployment issues.
153 TEST_F(SSLConfigServiceManagerPrefTest, NoCommandLinePrefs) { 155 TEST_F(SSLConfigServiceManagerPrefTest, NoCommandLinePrefs) {
154 scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore()); 156 scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore());
155 157
156 PrefServiceMockFactory factory; 158 PrefServiceMockFactory factory;
157 factory.set_user_prefs(local_state_store); 159 factory.set_user_prefs(local_state_store);
158 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple; 160 scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple;
159 scoped_ptr<PrefService> local_state(factory.Create(registry.get())); 161 scoped_ptr<PrefService> local_state(factory.Create(registry.get()));
160 162
161 SSLConfigServiceManager::RegisterPrefs(registry.get()); 163 SSLConfigServiceManager::RegisterPrefs(registry.get());
162 164
163 scoped_ptr<SSLConfigServiceManager> config_manager( 165 scoped_ptr<SSLConfigServiceManager> config_manager(
164 SSLConfigServiceManager::CreateDefaultManager(local_state.get())); 166 SSLConfigServiceManager::CreateDefaultManager(local_state.get()));
165 ASSERT_TRUE(config_manager.get()); 167 ASSERT_TRUE(config_manager.get());
166 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); 168 scoped_refptr<SSLConfigService> config_service(config_manager->Get());
167 ASSERT_TRUE(config_service.get()); 169 ASSERT_TRUE(config_service.get());
168 170
169 SSLConfig ssl_config; 171 SSLConfig ssl_config;
170 config_service->GetSSLConfig(&ssl_config); 172 config_service->GetSSLConfig(&ssl_config);
171 // The default value in the absence of command-line options is that 173 // The default value in the absence of command-line options is that
172 // SSL 3.0 ~ default_version_max() are enabled. 174 // SSL 3.0 ~ default_version_max() are enabled.
173 EXPECT_EQ(net::SSL_PROTOCOL_VERSION_SSL3, ssl_config.version_min); 175 EXPECT_EQ(net::SSL_PROTOCOL_VERSION_SSL3, ssl_config.version_min);
174 EXPECT_EQ(net::SSLConfigService::default_version_max(), 176 EXPECT_EQ(net::SSLConfigService::default_version_max(),
175 ssl_config.version_max); 177 ssl_config.version_max);
176 EXPECT_FALSE(ssl_config.unrestricted_ssl3_fallback_enabled); 178 EXPECT_TRUE(ssl_config.unrestricted_ssl3_fallback_enabled);
177 179
178 // The settings should not be added to the local_state. 180 // The settings should not be added to the local_state.
179 EXPECT_FALSE(local_state->HasPrefPath(prefs::kSSLVersionMin)); 181 EXPECT_FALSE(local_state->HasPrefPath(prefs::kSSLVersionMin));
180 EXPECT_FALSE(local_state->HasPrefPath(prefs::kSSLVersionMax)); 182 EXPECT_FALSE(local_state->HasPrefPath(prefs::kSSLVersionMax));
181 EXPECT_FALSE(local_state->HasPrefPath( 183 EXPECT_FALSE(local_state->HasPrefPath(
182 prefs::kEnableUnrestrictedSSL3Fallback)); 184 prefs::kEnableUnrestrictedSSL3Fallback));
183 185
184 // Explicitly double-check the settings are not in the preference store. 186 // Explicitly double-check the settings are not in the preference store.
185 std::string version_min_str; 187 std::string version_min_str;
186 std::string version_max_str; 188 std::string version_max_str;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 std::string version_max_str; 244 std::string version_max_str;
243 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin, 245 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMin,
244 &version_min_str)); 246 &version_min_str));
245 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax, 247 EXPECT_FALSE(local_state_store->GetString(prefs::kSSLVersionMax,
246 &version_max_str)); 248 &version_max_str));
247 bool unrestricted_ssl3_fallback_enabled; 249 bool unrestricted_ssl3_fallback_enabled;
248 EXPECT_FALSE(local_state_store->GetBoolean( 250 EXPECT_FALSE(local_state_store->GetBoolean(
249 prefs::kEnableUnrestrictedSSL3Fallback, 251 prefs::kEnableUnrestrictedSSL3Fallback,
250 &unrestricted_ssl3_fallback_enabled)); 252 &unrestricted_ssl3_fallback_enabled));
251 } 253 }
OLDNEW
« no previous file with comments | « chrome/browser/net/ssl_config_service_manager_pref.cc ('k') | chrome/common/chrome_switches.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698