| 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/base/ssl_config_service.h" | 5 #include "net/base/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/base/crl_set.h" | 10 #include "net/base/crl_set.h" |
| 11 #include "net/base/ssl_config_service_defaults.h" | 11 #include "net/base/ssl_config_service_defaults.h" |
| 12 #include "net/base/ssl_false_start_blacklist.h" | 12 #include "net/base/ssl_false_start_blacklist.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 SSLConfig::CertAndStatus::CertAndStatus() : cert_status(0) {} | 16 SSLConfig::CertAndStatus::CertAndStatus() : cert_status(0) {} |
| 17 | 17 |
| 18 SSLConfig::CertAndStatus::~CertAndStatus() {} | 18 SSLConfig::CertAndStatus::~CertAndStatus() {} |
| 19 | 19 |
| 20 SSLConfig::SSLConfig() | 20 SSLConfig::SSLConfig() |
| 21 : rev_checking_enabled(false), | 21 : rev_checking_enabled(false), |
| 22 ssl3_enabled(true), | 22 ssl3_enabled(true), |
| 23 tls1_enabled(true), | 23 tls1_enabled(true), |
| 24 cached_info_enabled(false), | 24 cached_info_enabled(false), |
| 25 origin_bound_certs_enabled(false), | 25 server_bound_certs_enabled(false), |
| 26 false_start_enabled(true), | 26 false_start_enabled(true), |
| 27 send_client_cert(false), | 27 send_client_cert(false), |
| 28 verify_ev_cert(false), | 28 verify_ev_cert(false), |
| 29 ssl3_fallback(false) { | 29 ssl3_fallback(false) { |
| 30 } | 30 } |
| 31 | 31 |
| 32 SSLConfig::~SSLConfig() { | 32 SSLConfig::~SSLConfig() { |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool SSLConfig::IsAllowedBadCert(X509Certificate* cert, | 35 bool SSLConfig::IsAllowedBadCert(X509Certificate* cert, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 123 } |
| 124 | 124 |
| 125 void SSLConfigService::ProcessConfigUpdate(const SSLConfig& orig_config, | 125 void SSLConfigService::ProcessConfigUpdate(const SSLConfig& orig_config, |
| 126 const SSLConfig& new_config) { | 126 const SSLConfig& new_config) { |
| 127 bool config_changed = | 127 bool config_changed = |
| 128 (orig_config.rev_checking_enabled != new_config.rev_checking_enabled) || | 128 (orig_config.rev_checking_enabled != new_config.rev_checking_enabled) || |
| 129 (orig_config.ssl3_enabled != new_config.ssl3_enabled) || | 129 (orig_config.ssl3_enabled != new_config.ssl3_enabled) || |
| 130 (orig_config.tls1_enabled != new_config.tls1_enabled) || | 130 (orig_config.tls1_enabled != new_config.tls1_enabled) || |
| 131 (orig_config.disabled_cipher_suites != | 131 (orig_config.disabled_cipher_suites != |
| 132 new_config.disabled_cipher_suites) || | 132 new_config.disabled_cipher_suites) || |
| 133 (orig_config.origin_bound_certs_enabled != | 133 (orig_config.server_bound_certs_enabled != |
| 134 new_config.origin_bound_certs_enabled) || | 134 new_config.server_bound_certs_enabled) || |
| 135 (orig_config.false_start_enabled != | 135 (orig_config.false_start_enabled != |
| 136 new_config.false_start_enabled); | 136 new_config.false_start_enabled); |
| 137 | 137 |
| 138 if (config_changed) | 138 if (config_changed) |
| 139 FOR_EACH_OBSERVER(Observer, observer_list_, OnSSLConfigChanged()); | 139 FOR_EACH_OBSERVER(Observer, observer_list_, OnSSLConfigChanged()); |
| 140 } | 140 } |
| 141 | 141 |
| 142 // static | 142 // static |
| 143 bool SSLConfigService::IsSNIAvailable(SSLConfigService* service) { | 143 bool SSLConfigService::IsSNIAvailable(SSLConfigService* service) { |
| 144 if (!service) | 144 if (!service) |
| 145 return false; | 145 return false; |
| 146 | 146 |
| 147 SSLConfig ssl_config; | 147 SSLConfig ssl_config; |
| 148 service->GetSSLConfig(&ssl_config); | 148 service->GetSSLConfig(&ssl_config); |
| 149 return ssl_config.tls1_enabled; | 149 return ssl_config.tls1_enabled; |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace net | 152 } // namespace net |
| OLD | NEW |