| 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 "net/ssl/ssl_config_service.h" | 5 #include "net/ssl/ssl_config_service.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
| 10 #include "net/cert/crl_set.h" | 10 #include "net/cert/crl_set.h" |
| 11 #include "net/ssl/ssl_config_service_defaults.h" | 11 #include "net/ssl/ssl_config_service_defaults.h" |
| 12 | 12 |
| 13 #if defined(USE_OPENSSL) | 13 #if defined(USE_OPENSSL) |
| 14 #include <openssl/ssl.h> | 14 #include <openssl/ssl.h> |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 | 18 |
| 19 static uint16 g_default_version_min = SSL_PROTOCOL_VERSION_SSL3; | 19 static uint16 g_default_version_min = SSL_PROTOCOL_VERSION_SSL3; |
| 20 | 20 |
| 21 static uint16 g_default_version_max = | 21 static uint16 g_default_version_max = |
| 22 #if defined(USE_OPENSSL) | 22 #if defined(USE_OPENSSL) |
| 23 #if defined(SSL_OP_NO_TLSv1_2) | 23 #if defined(SSL_OP_NO_TLSv1_1) |
| 24 SSL_PROTOCOL_VERSION_TLS1_2; | |
| 25 #elif defined(SSL_OP_NO_TLSv1_1) | |
| 26 SSL_PROTOCOL_VERSION_TLS1_1; | 24 SSL_PROTOCOL_VERSION_TLS1_1; |
| 27 #else | 25 #else |
| 28 SSL_PROTOCOL_VERSION_TLS1; | 26 SSL_PROTOCOL_VERSION_TLS1; |
| 29 #endif | 27 #endif |
| 30 #else | 28 #else |
| 31 SSL_PROTOCOL_VERSION_TLS1_2; | 29 SSL_PROTOCOL_VERSION_TLS1_1; |
| 32 #endif | 30 #endif |
| 33 | 31 |
| 34 SSLConfig::CertAndStatus::CertAndStatus() : cert_status(0) {} | 32 SSLConfig::CertAndStatus::CertAndStatus() : cert_status(0) {} |
| 35 | 33 |
| 36 SSLConfig::CertAndStatus::~CertAndStatus() {} | 34 SSLConfig::CertAndStatus::~CertAndStatus() {} |
| 37 | 35 |
| 38 SSLConfig::SSLConfig() | 36 SSLConfig::SSLConfig() |
| 39 : rev_checking_enabled(false), | 37 : rev_checking_enabled(false), |
| 40 rev_checking_required_local_anchors(false), | 38 rev_checking_required_local_anchors(false), |
| 41 version_min(g_default_version_min), | 39 version_min(g_default_version_min), |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 bool SSLConfigService::IsSNIAvailable(SSLConfigService* service) { | 172 bool SSLConfigService::IsSNIAvailable(SSLConfigService* service) { |
| 175 if (!service) | 173 if (!service) |
| 176 return false; | 174 return false; |
| 177 | 175 |
| 178 SSLConfig ssl_config; | 176 SSLConfig ssl_config; |
| 179 service->GetSSLConfig(&ssl_config); | 177 service->GetSSLConfig(&ssl_config); |
| 180 return ssl_config.version_max >= SSL_PROTOCOL_VERSION_TLS1; | 178 return ssl_config.version_max >= SSL_PROTOCOL_VERSION_TLS1; |
| 181 } | 179 } |
| 182 | 180 |
| 183 } // namespace net | 181 } // namespace net |
| OLD | NEW |