| 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_IMPL_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ |
| 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ |
| 7 | 7 |
| 8 #include <openssl/base.h> | 8 #include <openssl/base.h> |
| 9 #include <openssl/ssl.h> | 9 #include <openssl/ssl.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "net/base/completion_callback.h" | 22 #include "net/base/completion_callback.h" |
| 23 #include "net/base/io_buffer.h" | 23 #include "net/base/io_buffer.h" |
| 24 #include "net/cert/cert_verifier.h" | 24 #include "net/cert/cert_verifier.h" |
| 25 #include "net/cert/cert_verify_result.h" | 25 #include "net/cert/cert_verify_result.h" |
| 26 #include "net/cert/ct_verify_result.h" | 26 #include "net/cert/ct_verify_result.h" |
| 27 #include "net/log/net_log_with_source.h" | 27 #include "net/log/net_log_with_source.h" |
| 28 #include "net/socket/client_socket_handle.h" | 28 #include "net/socket/client_socket_handle.h" |
| 29 #include "net/socket/ssl_client_socket.h" | 29 #include "net/socket/ssl_client_socket.h" |
| 30 #include "net/ssl/channel_id_service.h" | 30 #include "net/ssl/channel_id_service.h" |
| 31 #include "net/ssl/openssl_ssl_util.h" | 31 #include "net/ssl/openssl_ssl_util.h" |
| 32 #include "net/ssl/scoped_openssl_types.h" | |
| 33 #include "net/ssl/ssl_client_cert_type.h" | 32 #include "net/ssl/ssl_client_cert_type.h" |
| 34 #include "net/ssl/ssl_config_service.h" | 33 #include "net/ssl/ssl_config_service.h" |
| 35 | 34 |
| 36 namespace base { | 35 namespace base { |
| 37 class FilePath; | 36 class FilePath; |
| 38 class SequencedTaskRunner; | 37 class SequencedTaskRunner; |
| 39 } | 38 } |
| 40 | 39 |
| 41 namespace crypto { | 40 namespace crypto { |
| 42 class OpenSSLErrStackTracer; | 41 class OpenSSLErrStackTracer; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 ct::CTVerifyResult ct_verify_result_; | 328 ct::CTVerifyResult ct_verify_result_; |
| 330 CTVerifier* cert_transparency_verifier_; | 329 CTVerifier* cert_transparency_verifier_; |
| 331 | 330 |
| 332 // The service for retrieving Channel ID keys. May be NULL. | 331 // The service for retrieving Channel ID keys. May be NULL. |
| 333 ChannelIDService* channel_id_service_; | 332 ChannelIDService* channel_id_service_; |
| 334 bool tb_was_negotiated_; | 333 bool tb_was_negotiated_; |
| 335 TokenBindingParam tb_negotiated_param_; | 334 TokenBindingParam tb_negotiated_param_; |
| 336 TokenBindingSignatureMap tb_signature_map_; | 335 TokenBindingSignatureMap tb_signature_map_; |
| 337 | 336 |
| 338 // OpenSSL stuff | 337 // OpenSSL stuff |
| 339 SSL* ssl_; | 338 bssl::UniquePtr<SSL> ssl_; |
| 340 BIO* transport_bio_; | 339 bssl::UniquePtr<BIO> transport_bio_; |
| 341 | 340 |
| 342 std::unique_ptr<ClientSocketHandle> transport_; | 341 std::unique_ptr<ClientSocketHandle> transport_; |
| 343 const HostPortPair host_and_port_; | 342 const HostPortPair host_and_port_; |
| 344 SSLConfig ssl_config_; | 343 SSLConfig ssl_config_; |
| 345 // ssl_session_cache_shard_ is an opaque string that partitions the SSL | 344 // ssl_session_cache_shard_ is an opaque string that partitions the SSL |
| 346 // session cache. i.e. sessions created with one value will not attempt to | 345 // session cache. i.e. sessions created with one value will not attempt to |
| 347 // resume on the socket with a different value. | 346 // resume on the socket with a different value. |
| 348 const std::string ssl_session_cache_shard_; | 347 const std::string ssl_session_cache_shard_; |
| 349 | 348 |
| 350 enum State { | 349 enum State { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 361 // True if the socket has been disconnected. | 360 // True if the socket has been disconnected. |
| 362 bool disconnected_; | 361 bool disconnected_; |
| 363 | 362 |
| 364 NextProto negotiated_protocol_; | 363 NextProto negotiated_protocol_; |
| 365 // Written by the |channel_id_service_|. | 364 // Written by the |channel_id_service_|. |
| 366 std::unique_ptr<crypto::ECPrivateKey> channel_id_key_; | 365 std::unique_ptr<crypto::ECPrivateKey> channel_id_key_; |
| 367 // True if a channel ID was sent. | 366 // True if a channel ID was sent. |
| 368 bool channel_id_sent_; | 367 bool channel_id_sent_; |
| 369 // If non-null, the newly-established to be inserted into the session cache | 368 // If non-null, the newly-established to be inserted into the session cache |
| 370 // once certificate verification is done. | 369 // once certificate verification is done. |
| 371 ScopedSSL_SESSION pending_session_; | 370 bssl::UniquePtr<SSL_SESSION> pending_session_; |
| 372 // True if the initial handshake's certificate has been verified. | 371 // True if the initial handshake's certificate has been verified. |
| 373 bool certificate_verified_; | 372 bool certificate_verified_; |
| 374 // Set to true if a CertificateRequest was received. | 373 // Set to true if a CertificateRequest was received. |
| 375 bool certificate_requested_; | 374 bool certificate_requested_; |
| 376 // The request handle for |channel_id_service_|. | 375 // The request handle for |channel_id_service_|. |
| 377 ChannelIDService::Request channel_id_request_; | 376 ChannelIDService::Request channel_id_request_; |
| 378 | 377 |
| 379 int signature_result_; | 378 int signature_result_; |
| 380 std::vector<uint8_t> signature_; | 379 std::vector<uint8_t> signature_; |
| 381 | 380 |
| 382 TransportSecurityState* transport_security_state_; | 381 TransportSecurityState* transport_security_state_; |
| 383 | 382 |
| 384 CTPolicyEnforcer* const policy_enforcer_; | 383 CTPolicyEnforcer* const policy_enforcer_; |
| 385 | 384 |
| 386 // pinning_failure_log contains a message produced by | 385 // pinning_failure_log contains a message produced by |
| 387 // TransportSecurityState::CheckPublicKeyPins in the event of a | 386 // TransportSecurityState::CheckPublicKeyPins in the event of a |
| 388 // pinning failure. It is a (somewhat) human-readable string. | 387 // pinning failure. It is a (somewhat) human-readable string. |
| 389 std::string pinning_failure_log_; | 388 std::string pinning_failure_log_; |
| 390 | 389 |
| 391 // True if PKP is bypassed due to a local trust anchor. | 390 // True if PKP is bypassed due to a local trust anchor. |
| 392 bool pkp_bypassed_; | 391 bool pkp_bypassed_; |
| 393 | 392 |
| 394 NetLogWithSource net_log_; | 393 NetLogWithSource net_log_; |
| 395 base::WeakPtrFactory<SSLClientSocketImpl> weak_factory_; | 394 base::WeakPtrFactory<SSLClientSocketImpl> weak_factory_; |
| 396 }; | 395 }; |
| 397 | 396 |
| 398 } // namespace net | 397 } // namespace net |
| 399 | 398 |
| 400 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ | 399 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ |
| OLD | NEW |