| 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 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
| 14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 15 #include "net/cert/cert_verifier.h" |
| 15 #include "net/cert/cert_verify_result.h" | 16 #include "net/cert/cert_verify_result.h" |
| 16 #include "net/cert/ct_verify_result.h" | 17 #include "net/cert/ct_verify_result.h" |
| 17 #include "net/socket/client_socket_handle.h" | 18 #include "net/socket/client_socket_handle.h" |
| 18 #include "net/socket/ssl_client_socket.h" | 19 #include "net/socket/ssl_client_socket.h" |
| 19 #include "net/ssl/channel_id_service.h" | 20 #include "net/ssl/channel_id_service.h" |
| 20 #include "net/ssl/openssl_ssl_util.h" | 21 #include "net/ssl/openssl_ssl_util.h" |
| 21 #include "net/ssl/ssl_client_cert_type.h" | 22 #include "net/ssl/ssl_client_cert_type.h" |
| 22 #include "net/ssl/ssl_config_service.h" | 23 #include "net/ssl/ssl_config_service.h" |
| 23 | 24 |
| 24 // Avoid including misc OpenSSL headers, i.e.: | 25 // Avoid including misc OpenSSL headers, i.e.: |
| 25 // <openssl/bio.h> | 26 // <openssl/bio.h> |
| 26 typedef struct bio_st BIO; | 27 typedef struct bio_st BIO; |
| 27 // <openssl/evp.h> | 28 // <openssl/evp.h> |
| 28 typedef struct evp_pkey_st EVP_PKEY; | 29 typedef struct evp_pkey_st EVP_PKEY; |
| 29 // <openssl/ssl.h> | 30 // <openssl/ssl.h> |
| 30 typedef struct ssl_st SSL; | 31 typedef struct ssl_st SSL; |
| 31 // <openssl/x509.h> | 32 // <openssl/x509.h> |
| 32 typedef struct x509_st X509; | 33 typedef struct x509_st X509; |
| 33 // <openssl/ossl_type.h> | 34 // <openssl/ossl_type.h> |
| 34 typedef struct x509_store_ctx_st X509_STORE_CTX; | 35 typedef struct x509_store_ctx_st X509_STORE_CTX; |
| 35 | 36 |
| 36 namespace net { | 37 namespace net { |
| 37 | 38 |
| 38 class CertVerifier; | 39 class CertVerifier; |
| 39 class CTVerifier; | 40 class CTVerifier; |
| 40 class SingleRequestCertVerifier; | |
| 41 class SSLCertRequestInfo; | 41 class SSLCertRequestInfo; |
| 42 class SSLInfo; | 42 class SSLInfo; |
| 43 | 43 |
| 44 // An SSL client socket implemented with OpenSSL. | 44 // An SSL client socket implemented with OpenSSL. |
| 45 class SSLClientSocketOpenSSL : public SSLClientSocket { | 45 class SSLClientSocketOpenSSL : public SSLClientSocket { |
| 46 public: | 46 public: |
| 47 // Takes ownership of the transport_socket, which may already be connected. | 47 // Takes ownership of the transport_socket, which may already be connected. |
| 48 // The given hostname will be compared with the name(s) in the server's | 48 // The given hostname will be compared with the name(s) in the server's |
| 49 // certificate during the SSL handshake. ssl_config specifies the SSL | 49 // certificate during the SSL handshake. ssl_config specifies the SSL |
| 50 // settings. | 50 // settings. |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 // GetSSLCertRequestInfo calls. | 247 // GetSSLCertRequestInfo calls. |
| 248 bool client_auth_cert_needed_; | 248 bool client_auth_cert_needed_; |
| 249 // List of DER-encoded X.509 DistinguishedName of certificate authorities | 249 // List of DER-encoded X.509 DistinguishedName of certificate authorities |
| 250 // allowed by the server. | 250 // allowed by the server. |
| 251 std::vector<std::string> cert_authorities_; | 251 std::vector<std::string> cert_authorities_; |
| 252 // List of SSLClientCertType values for client certificates allowed by the | 252 // List of SSLClientCertType values for client certificates allowed by the |
| 253 // server. | 253 // server. |
| 254 std::vector<SSLClientCertType> cert_key_types_; | 254 std::vector<SSLClientCertType> cert_key_types_; |
| 255 | 255 |
| 256 CertVerifier* const cert_verifier_; | 256 CertVerifier* const cert_verifier_; |
| 257 scoped_ptr<SingleRequestCertVerifier> verifier_; | 257 scoped_ptr<CertVerifier::Request> cert_verifier_request_; |
| 258 base::TimeTicks start_cert_verification_time_; | 258 base::TimeTicks start_cert_verification_time_; |
| 259 | 259 |
| 260 // Certificate Transparency: Verifier and result holder. | 260 // Certificate Transparency: Verifier and result holder. |
| 261 ct::CTVerifyResult ct_verify_result_; | 261 ct::CTVerifyResult ct_verify_result_; |
| 262 CTVerifier* cert_transparency_verifier_; | 262 CTVerifier* cert_transparency_verifier_; |
| 263 | 263 |
| 264 // The service for retrieving Channel ID keys. May be NULL. | 264 // The service for retrieving Channel ID keys. May be NULL. |
| 265 ChannelIDService* channel_id_service_; | 265 ChannelIDService* channel_id_service_; |
| 266 | 266 |
| 267 // OpenSSL stuff | 267 // OpenSSL stuff |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 // pinning failure. It is a (somewhat) human-readable string. | 308 // pinning failure. It is a (somewhat) human-readable string. |
| 309 std::string pinning_failure_log_; | 309 std::string pinning_failure_log_; |
| 310 | 310 |
| 311 BoundNetLog net_log_; | 311 BoundNetLog net_log_; |
| 312 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; | 312 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; |
| 313 }; | 313 }; |
| 314 | 314 |
| 315 } // namespace net | 315 } // namespace net |
| 316 | 316 |
| 317 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 317 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| OLD | NEW |