Chromium Code Reviews| OLD | NEW | 
|---|---|
| 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 "components/ssl_config/ssl_config_service_manager.h" | 5 #include "components/ssl_config/ssl_config_service_manager.h" | 
| 6 | 6 | 
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" | 
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" | 
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" | 
| 10 #include "base/values.h" | 10 #include "base/values.h" | 
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 &local_state, base::ThreadTaskRunnerHandle::Get())); | 166 &local_state, base::ThreadTaskRunnerHandle::Get())); | 
| 167 ASSERT_TRUE(config_manager.get()); | 167 ASSERT_TRUE(config_manager.get()); | 
| 168 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); | 168 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); | 
| 169 ASSERT_TRUE(config_service.get()); | 169 ASSERT_TRUE(config_service.get()); | 
| 170 | 170 | 
| 171 SSLConfig ssl_config; | 171 SSLConfig ssl_config; | 
| 172 config_service->GetSSLConfig(&ssl_config); | 172 config_service->GetSSLConfig(&ssl_config); | 
| 173 // The command-line option must not have been honored. | 173 // The command-line option must not have been honored. | 
| 174 EXPECT_LE(net::SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_min); | 174 EXPECT_LE(net::SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_min); | 
| 175 } | 175 } | 
| 176 | |
| 177 // Tests that fallback beyond TLS 1.0 cannot be re-enabled. | |
| 
 
Ryan Sleevi
2016/02/09 07:22:29
And if they force a field trial via --force-fieldt
 
 | |
| 178 TEST_F(SSLConfigServiceManagerPrefTest, NoTLS1Fallback) { | |
| 179 scoped_refptr<TestingPrefStore> local_state_store(new TestingPrefStore()); | |
| 180 | |
| 181 TestingPrefServiceSimple local_state; | |
| 182 local_state.SetUserPref(ssl_config::prefs::kSSLVersionFallbackMin, | |
| 183 new base::StringValue("tls1")); | |
| 184 SSLConfigServiceManager::RegisterPrefs(local_state.registry()); | |
| 185 | |
| 186 scoped_ptr<SSLConfigServiceManager> config_manager( | |
| 187 SSLConfigServiceManager::CreateDefaultManager( | |
| 188 &local_state, base::ThreadTaskRunnerHandle::Get())); | |
| 189 ASSERT_TRUE(config_manager.get()); | |
| 190 scoped_refptr<SSLConfigService> config_service(config_manager->Get()); | |
| 191 ASSERT_TRUE(config_service.get()); | |
| 192 | |
| 193 SSLConfig ssl_config; | |
| 194 config_service->GetSSLConfig(&ssl_config); | |
| 195 // The command-line option must not have been honored. | |
| 196 EXPECT_EQ(net::SSL_PROTOCOL_VERSION_TLS1_2, ssl_config.version_fallback_min); | |
| 197 } | |
| OLD | NEW |