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 "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 "net/base/crl_set.h" | 9 #include "net/base/crl_set.h" |
10 #include "net/base/ssl_config_service_defaults.h" | 10 #include "net/base/ssl_config_service_defaults.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 false_start_enabled(true), | 24 false_start_enabled(true), |
25 send_client_cert(false), verify_ev_cert(false), ssl3_fallback(false) { | 25 send_client_cert(false), verify_ev_cert(false), ssl3_fallback(false) { |
26 } | 26 } |
27 | 27 |
28 SSLConfig::~SSLConfig() { | 28 SSLConfig::~SSLConfig() { |
29 } | 29 } |
30 | 30 |
31 bool SSLConfig::IsAllowedBadCert(X509Certificate* cert, | 31 bool SSLConfig::IsAllowedBadCert(X509Certificate* cert, |
32 CertStatus* cert_status) const { | 32 CertStatus* cert_status) const { |
33 std::string der_cert; | 33 std::string der_cert; |
34 if (!cert->GetDEREncoded(&der_cert)) | 34 if (!X509Certificate::GetDEREncoded(cert->os_cert_handle(), &der_cert)) |
35 return false; | 35 return false; |
36 return IsAllowedBadCert(der_cert, cert_status); | 36 return IsAllowedBadCert(der_cert, cert_status); |
37 } | 37 } |
38 | 38 |
39 bool SSLConfig::IsAllowedBadCert(const base::StringPiece& der_cert, | 39 bool SSLConfig::IsAllowedBadCert(const base::StringPiece& der_cert, |
40 CertStatus* cert_status) const { | 40 CertStatus* cert_status) const { |
41 for (size_t i = 0; i < allowed_bad_certs.size(); ++i) { | 41 for (size_t i = 0; i < allowed_bad_certs.size(); ++i) { |
42 if (der_cert == allowed_bad_certs[i].der_cert) { | 42 if (der_cert == allowed_bad_certs[i].der_cert) { |
43 if (cert_status) | 43 if (cert_status) |
44 *cert_status = allowed_bad_certs[i].cert_status; | 44 *cert_status = allowed_bad_certs[i].cert_status; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 bool SSLConfigService::IsSNIAvailable(SSLConfigService* service) { | 152 bool SSLConfigService::IsSNIAvailable(SSLConfigService* service) { |
153 if (!service) | 153 if (!service) |
154 return false; | 154 return false; |
155 | 155 |
156 SSLConfig ssl_config; | 156 SSLConfig ssl_config; |
157 service->GetSSLConfig(&ssl_config); | 157 service->GetSSLConfig(&ssl_config); |
158 return ssl_config.tls1_enabled; | 158 return ssl_config.tls1_enabled; |
159 } | 159 } |
160 | 160 |
161 } // namespace net | 161 } // namespace net |
OLD | NEW |