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 #include "chrome/browser/net/ssl_config_service_manager.h" | 4 #include "chrome/browser/net/ssl_config_service_manager.h" |
5 | 5 |
6 #include <algorithm> | 6 #include <algorithm> |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 cipher_suites.push_back(cipher_suite); | 68 cipher_suites.push_back(cipher_suite); |
69 } | 69 } |
70 std::sort(cipher_suites.begin(), cipher_suites.end()); | 70 std::sort(cipher_suites.begin(), cipher_suites.end()); |
71 return cipher_suites; | 71 return cipher_suites; |
72 } | 72 } |
73 | 73 |
74 // Returns the SSL protocol version (as a uint16) represented by a string. | 74 // Returns the SSL protocol version (as a uint16) represented by a string. |
75 // Returns 0 if the string is invalid. | 75 // Returns 0 if the string is invalid. |
76 uint16 SSLProtocolVersionFromString(const std::string& version_str) { | 76 uint16 SSLProtocolVersionFromString(const std::string& version_str) { |
77 uint16 version = 0; // Invalid. | 77 uint16 version = 0; // Invalid. |
78 if (version_str == switches::kSSLVersionSSLv3) { | 78 if (version_str == switches::kSSLVersionTLSv1) { |
79 version = net::SSL_PROTOCOL_VERSION_SSL3; | |
80 } else if (version_str == switches::kSSLVersionTLSv1) { | |
81 version = net::SSL_PROTOCOL_VERSION_TLS1; | 79 version = net::SSL_PROTOCOL_VERSION_TLS1; |
82 } else if (version_str == switches::kSSLVersionTLSv11) { | 80 } else if (version_str == switches::kSSLVersionTLSv11) { |
83 version = net::SSL_PROTOCOL_VERSION_TLS1_1; | 81 version = net::SSL_PROTOCOL_VERSION_TLS1_1; |
84 } else if (version_str == switches::kSSLVersionTLSv12) { | 82 } else if (version_str == switches::kSSLVersionTLSv12) { |
85 version = net::SSL_PROTOCOL_VERSION_TLS1_2; | 83 version = net::SSL_PROTOCOL_VERSION_TLS1_2; |
86 } | 84 } |
87 return version; | 85 return version; |
88 } | 86 } |
89 | 87 |
90 } // namespace | 88 } // namespace |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 // static | 313 // static |
316 SSLConfigServiceManager* SSLConfigServiceManager::CreateDefaultManager( | 314 SSLConfigServiceManager* SSLConfigServiceManager::CreateDefaultManager( |
317 PrefService* local_state) { | 315 PrefService* local_state) { |
318 return new SSLConfigServiceManagerPref(local_state); | 316 return new SSLConfigServiceManagerPref(local_state); |
319 } | 317 } |
320 | 318 |
321 // static | 319 // static |
322 void SSLConfigServiceManager::RegisterPrefs(PrefRegistrySimple* registry) { | 320 void SSLConfigServiceManager::RegisterPrefs(PrefRegistrySimple* registry) { |
323 SSLConfigServiceManagerPref::RegisterPrefs(registry); | 321 SSLConfigServiceManagerPref::RegisterPrefs(registry); |
324 } | 322 } |
OLD | NEW |