| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "net/base/ssl_config_service_defaults.h" | 7 #include "net/base/ssl_config_service_defaults.h" |
| 8 #include "net/base/ssl_false_start_blacklist.h" | 8 #include "net/base/ssl_false_start_blacklist.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 SSLConfig::CertAndStatus::CertAndStatus() : cert_status(0) {} | 12 SSLConfig::CertAndStatus::CertAndStatus() : cert_status(0) {} |
| 13 | 13 |
| 14 SSLConfig::CertAndStatus::~CertAndStatus() {} | 14 SSLConfig::CertAndStatus::~CertAndStatus() {} |
| 15 | 15 |
| 16 SSLConfig::SSLConfig() | 16 SSLConfig::SSLConfig() |
| 17 : rev_checking_enabled(true), ssl3_enabled(true), | 17 : rev_checking_enabled(true), ssl3_enabled(true), |
| 18 tls1_enabled(true), | 18 tls1_enabled(true), |
| 19 dns_cert_provenance_checking_enabled(false), cached_info_enabled(false), | 19 dns_cert_provenance_checking_enabled(false), cached_info_enabled(false), |
| 20 origin_bound_certs_enabled(false), | 20 origin_bound_certs_enabled(false), |
| 21 false_start_enabled(true), | 21 false_start_enabled(true), |
| 22 send_client_cert(false), verify_ev_cert(false), ssl3_fallback(false) { | 22 send_client_cert(false), verify_ev_cert(false), ssl3_fallback(false) { |
| 23 } | 23 } |
| 24 | 24 |
| 25 SSLConfig::~SSLConfig() { | 25 SSLConfig::~SSLConfig() { |
| 26 } | 26 } |
| 27 | 27 |
| 28 bool SSLConfig::IsAllowedBadCert(X509Certificate* cert, | 28 bool SSLConfig::IsAllowedBadCert(X509Certificate* cert, |
| 29 CertStatus* cert_status) const { | 29 int* cert_status) const { |
| 30 std::string der_cert; | 30 std::string der_cert; |
| 31 if (!cert->GetDEREncoded(&der_cert)) | 31 if (!cert->GetDEREncoded(&der_cert)) |
| 32 return false; | 32 return false; |
| 33 return IsAllowedBadCert(der_cert, cert_status); | 33 return IsAllowedBadCert(der_cert, cert_status); |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool SSLConfig::IsAllowedBadCert(const base::StringPiece& der_cert, | 36 bool SSLConfig::IsAllowedBadCert(const base::StringPiece& der_cert, |
| 37 CertStatus* cert_status) const { | 37 int* cert_status) const { |
| 38 for (size_t i = 0; i < allowed_bad_certs.size(); ++i) { | 38 for (size_t i = 0; i < allowed_bad_certs.size(); ++i) { |
| 39 if (der_cert == allowed_bad_certs[i].der_cert) { | 39 if (der_cert == allowed_bad_certs[i].der_cert) { |
| 40 if (cert_status) | 40 if (cert_status) |
| 41 *cert_status = allowed_bad_certs[i].cert_status; | 41 *cert_status = allowed_bad_certs[i].cert_status; |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 return false; | 45 return false; |
| 46 } | 46 } |
| 47 | 47 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 bool SSLConfigService::IsSNIAvailable(SSLConfigService* service) { | 141 bool SSLConfigService::IsSNIAvailable(SSLConfigService* service) { |
| 142 if (!service) | 142 if (!service) |
| 143 return false; | 143 return false; |
| 144 | 144 |
| 145 SSLConfig ssl_config; | 145 SSLConfig ssl_config; |
| 146 service->GetSSLConfig(&ssl_config); | 146 service->GetSSLConfig(&ssl_config); |
| 147 return ssl_config.tls1_enabled; | 147 return ssl_config.tls1_enabled; |
| 148 } | 148 } |
| 149 | 149 |
| 150 } // namespace net | 150 } // namespace net |
| OLD | NEW |