| 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_verifier.h" |
| 16 #include "net/cert/cert_verify_result.h" | 16 #include "net/cert/cert_verify_result.h" |
| 17 #include "net/cert/ct_verify_result.h" | 17 #include "net/cert/ct_verify_result.h" |
| 18 #include "net/socket/client_socket_handle.h" | 18 #include "net/socket/client_socket_handle.h" |
| 19 #include "net/socket/ssl_client_socket.h" | 19 #include "net/socket/ssl_client_socket.h" |
| 20 #include "net/ssl/channel_id_service.h" | 20 #include "net/ssl/channel_id_service.h" |
| 21 #include "net/ssl/openssl_ssl_util.h" | 21 #include "net/ssl/openssl_ssl_util.h" |
| 22 #include "net/ssl/ssl_client_cert_type.h" | 22 #include "net/ssl/ssl_client_cert_type.h" |
| 23 #include "net/ssl/ssl_config_service.h" | 23 #include "net/ssl/ssl_config_service.h" |
| 24 #include "net/ssl/ssl_failure_state.h" |
| 24 | 25 |
| 25 // Avoid including misc OpenSSL headers, i.e.: | 26 // Avoid including misc OpenSSL headers, i.e.: |
| 26 // <openssl/bio.h> | 27 // <openssl/bio.h> |
| 27 typedef struct bio_st BIO; | 28 typedef struct bio_st BIO; |
| 28 // <openssl/evp.h> | 29 // <openssl/evp.h> |
| 29 typedef struct evp_pkey_st EVP_PKEY; | 30 typedef struct evp_pkey_st EVP_PKEY; |
| 30 // <openssl/ssl.h> | 31 // <openssl/ssl.h> |
| 31 typedef struct ssl_st SSL; | 32 typedef struct ssl_st SSL; |
| 32 // <openssl/x509.h> | 33 // <openssl/x509.h> |
| 33 typedef struct x509_st X509; | 34 typedef struct x509_st X509; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 56 | 57 |
| 57 const HostPortPair& host_and_port() const { return host_and_port_; } | 58 const HostPortPair& host_and_port() const { return host_and_port_; } |
| 58 const std::string& ssl_session_cache_shard() const { | 59 const std::string& ssl_session_cache_shard() const { |
| 59 return ssl_session_cache_shard_; | 60 return ssl_session_cache_shard_; |
| 60 } | 61 } |
| 61 | 62 |
| 62 // SSLClientSocket implementation. | 63 // SSLClientSocket implementation. |
| 63 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override; | 64 void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info) override; |
| 64 NextProtoStatus GetNextProto(std::string* proto) const override; | 65 NextProtoStatus GetNextProto(std::string* proto) const override; |
| 65 ChannelIDService* GetChannelIDService() const override; | 66 ChannelIDService* GetChannelIDService() const override; |
| 67 SSLFailureState GetSSLFailureState() const override; |
| 66 | 68 |
| 67 // SSLSocket implementation. | 69 // SSLSocket implementation. |
| 68 int ExportKeyingMaterial(const base::StringPiece& label, | 70 int ExportKeyingMaterial(const base::StringPiece& label, |
| 69 bool has_context, | 71 bool has_context, |
| 70 const base::StringPiece& context, | 72 const base::StringPiece& context, |
| 71 unsigned char* out, | 73 unsigned char* out, |
| 72 unsigned int outlen) override; | 74 unsigned int outlen) override; |
| 73 int GetTLSUniqueChannelBinding(std::string* out) override; | 75 int GetTLSUniqueChannelBinding(std::string* out) override; |
| 74 | 76 |
| 75 // StreamSocket implementation. | 77 // StreamSocket implementation. |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 std::string channel_id_private_key_; | 295 std::string channel_id_private_key_; |
| 294 std::string channel_id_cert_; | 296 std::string channel_id_cert_; |
| 295 // True if a channel ID was sent. | 297 // True if a channel ID was sent. |
| 296 bool channel_id_sent_; | 298 bool channel_id_sent_; |
| 297 // True if the initial handshake has completed. | 299 // True if the initial handshake has completed. |
| 298 bool handshake_completed_; | 300 bool handshake_completed_; |
| 299 // True if the initial handshake's certificate has been verified. | 301 // True if the initial handshake's certificate has been verified. |
| 300 bool certificate_verified_; | 302 bool certificate_verified_; |
| 301 // The request handle for |channel_id_service_|. | 303 // The request handle for |channel_id_service_|. |
| 302 ChannelIDService::RequestHandle channel_id_request_handle_; | 304 ChannelIDService::RequestHandle channel_id_request_handle_; |
| 305 SSLFailureState ssl_failure_state_; |
| 303 | 306 |
| 304 TransportSecurityState* transport_security_state_; | 307 TransportSecurityState* transport_security_state_; |
| 305 | 308 |
| 306 CertPolicyEnforcer* const policy_enforcer_; | 309 CertPolicyEnforcer* const policy_enforcer_; |
| 307 | 310 |
| 308 // pinning_failure_log contains a message produced by | 311 // pinning_failure_log contains a message produced by |
| 309 // TransportSecurityState::CheckPublicKeyPins in the event of a | 312 // TransportSecurityState::CheckPublicKeyPins in the event of a |
| 310 // pinning failure. It is a (somewhat) human-readable string. | 313 // pinning failure. It is a (somewhat) human-readable string. |
| 311 std::string pinning_failure_log_; | 314 std::string pinning_failure_log_; |
| 312 | 315 |
| 313 BoundNetLog net_log_; | 316 BoundNetLog net_log_; |
| 314 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; | 317 base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_; |
| 315 }; | 318 }; |
| 316 | 319 |
| 317 } // namespace net | 320 } // namespace net |
| 318 | 321 |
| 319 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ | 322 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ |
| OLD | NEW |