Chromium Code Reviews| 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 #ifndef NET_SOCKET_SSL_HOST_INFO_H_ | 5 #ifndef NET_SOCKET_SSL_HOST_INFO_H_ |
| 6 #define NET_SOCKET_SSL_HOST_INFO_H_ | 6 #define NET_SOCKET_SSL_HOST_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "net/base/cert_verifier.h" | 15 #include "net/base/cert_verifier.h" |
| 16 #include "net/base/cert_verify_result.h" | 16 #include "net/base/cert_verify_result.h" |
| 17 #include "net/base/completion_callback.h" | 17 #include "net/base/completion_callback.h" |
| 18 #include "net/base/crl_set.h" | |
|
wtc
2011/10/21 23:17:31
Does a forward declaration of CRLSet work?
agl
2011/10/24 20:44:27
Done.
| |
| 18 #include "net/base/dnsrr_resolver.h" | 19 #include "net/base/dnsrr_resolver.h" |
| 19 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
| 20 #include "net/socket/ssl_client_socket.h" | 21 #include "net/socket/ssl_client_socket.h" |
| 21 | 22 |
| 22 namespace net { | 23 namespace net { |
| 23 | 24 |
| 24 class X509Certificate; | 25 class X509Certificate; |
| 25 struct SSLConfig; | 26 struct SSLConfig; |
| 26 | 27 |
| 27 // SSLHostInfo is an interface for fetching information about an SSL server. | 28 // SSLHostInfo is an interface for fetching information about an SSL server. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 114 // This is the callback function which the CertVerifier calls via |callback_|. | 115 // This is the callback function which the CertVerifier calls via |callback_|. |
| 115 void VerifyCallback(int rv); | 116 void VerifyCallback(int rv); |
| 116 | 117 |
| 117 // ParseInner is a helper function for Parse. | 118 // ParseInner is a helper function for Parse. |
| 118 bool ParseInner(const std::string& data); | 119 bool ParseInner(const std::string& data); |
| 119 | 120 |
| 120 // This is the hostname that we'll validate the certificates against. | 121 // This is the hostname that we'll validate the certificates against. |
| 121 const std::string hostname_; | 122 const std::string hostname_; |
| 122 bool cert_parsing_failed_; | 123 bool cert_parsing_failed_; |
| 123 OldCompletionCallback* cert_verification_callback_; | 124 OldCompletionCallback* cert_verification_callback_; |
| 124 // These two members are taken from the SSLConfig. | 125 // These three members are taken from the SSLConfig. |
| 125 bool rev_checking_enabled_; | 126 bool rev_checking_enabled_; |
| 126 bool verify_ev_cert_; | 127 bool verify_ev_cert_; |
| 128 scoped_refptr<CRLSet> crl_set_; | |
| 127 base::TimeTicks verification_start_time_; | 129 base::TimeTicks verification_start_time_; |
| 128 base::TimeTicks verification_end_time_; | 130 base::TimeTicks verification_end_time_; |
| 129 CertVerifyResult cert_verify_result_; | 131 CertVerifyResult cert_verify_result_; |
| 130 SingleRequestCertVerifier verifier_; | 132 SingleRequestCertVerifier verifier_; |
| 131 scoped_refptr<X509Certificate> cert_; | 133 scoped_refptr<X509Certificate> cert_; |
| 132 base::WeakPtrFactory<SSLHostInfo> weak_factory_; | 134 base::WeakPtrFactory<SSLHostInfo> weak_factory_; |
| 133 | 135 |
| 134 DnsRRResolver* dnsrr_resolver_; | 136 DnsRRResolver* dnsrr_resolver_; |
| 135 OldCompletionCallback* dns_callback_; | 137 OldCompletionCallback* dns_callback_; |
| 136 DnsRRResolver::Handle dns_handle_; | 138 DnsRRResolver::Handle dns_handle_; |
| 137 RRResponse dns_response_; | 139 RRResponse dns_response_; |
| 138 base::TimeTicks dns_lookup_start_time_; | 140 base::TimeTicks dns_lookup_start_time_; |
| 139 base::TimeTicks cert_verification_finished_time_; | 141 base::TimeTicks cert_verification_finished_time_; |
| 140 }; | 142 }; |
| 141 | 143 |
| 142 class SSLHostInfoFactory { | 144 class SSLHostInfoFactory { |
| 143 public: | 145 public: |
| 144 virtual ~SSLHostInfoFactory(); | 146 virtual ~SSLHostInfoFactory(); |
| 145 | 147 |
| 146 // GetForHost returns a fresh, allocated SSLHostInfo for the given hostname | 148 // GetForHost returns a fresh, allocated SSLHostInfo for the given hostname |
| 147 // or NULL on failure. | 149 // or NULL on failure. |
| 148 virtual SSLHostInfo* GetForHost(const std::string& hostname, | 150 virtual SSLHostInfo* GetForHost(const std::string& hostname, |
| 149 const SSLConfig& ssl_config) = 0; | 151 const SSLConfig& ssl_config) = 0; |
| 150 }; | 152 }; |
| 151 | 153 |
| 152 } // namespace net | 154 } // namespace net |
| 153 | 155 |
| 154 #endif // NET_SOCKET_SSL_HOST_INFO_H_ | 156 #endif // NET_SOCKET_SSL_HOST_INFO_H_ |
| OLD | NEW |