| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 // Callback from the SSL layer that indicates the remote server is requesting | 160 // Callback from the SSL layer that indicates the remote server is requesting |
| 161 // a certificate for this client. | 161 // a certificate for this client. |
| 162 int ClientCertRequestCallback(SSL* ssl); | 162 int ClientCertRequestCallback(SSL* ssl); |
| 163 | 163 |
| 164 // CertVerifyCallback is called to verify the server's certificates. We do | 164 // CertVerifyCallback is called to verify the server's certificates. We do |
| 165 // verification after the handshake so this function only enforces that the | 165 // verification after the handshake so this function only enforces that the |
| 166 // certificates don't change during renegotiation. | 166 // certificates don't change during renegotiation. |
| 167 int CertVerifyCallback(X509_STORE_CTX* store_ctx); | 167 int CertVerifyCallback(X509_STORE_CTX* store_ctx); |
| 168 | 168 |
| 169 // Callback from the SSL layer to check which NPN protocol we are supporting | |
| 170 int SelectNextProtoCallback(unsigned char** out, | |
| 171 unsigned char* outlen, | |
| 172 const unsigned char* in, | |
| 173 unsigned int inlen); | |
| 174 | |
| 175 // Called during an operation on |transport_bio_|'s peer. Checks saved | 169 // Called during an operation on |transport_bio_|'s peer. Checks saved |
| 176 // transport error state and, if appropriate, returns an error through | 170 // transport error state and, if appropriate, returns an error through |
| 177 // OpenSSL's error system. | 171 // OpenSSL's error system. |
| 178 long MaybeReplayTransportError(BIO* bio, | 172 long MaybeReplayTransportError(BIO* bio, |
| 179 int cmd, | 173 int cmd, |
| 180 const char* argp, | 174 const char* argp, |
| 181 int argi, | 175 int argi, |
| 182 long argl, | 176 long argl, |
| 183 long retvalue); | 177 long retvalue); |
| 184 | 178 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 STATE_CHANNEL_ID_LOOKUP, | 340 STATE_CHANNEL_ID_LOOKUP, |
| 347 STATE_CHANNEL_ID_LOOKUP_COMPLETE, | 341 STATE_CHANNEL_ID_LOOKUP_COMPLETE, |
| 348 STATE_VERIFY_CERT, | 342 STATE_VERIFY_CERT, |
| 349 STATE_VERIFY_CERT_COMPLETE, | 343 STATE_VERIFY_CERT_COMPLETE, |
| 350 }; | 344 }; |
| 351 State next_handshake_state_; | 345 State next_handshake_state_; |
| 352 | 346 |
| 353 // True if the socket has been disconnected. | 347 // True if the socket has been disconnected. |
| 354 bool disconnected_; | 348 bool disconnected_; |
| 355 | 349 |
| 356 NextProtoStatus npn_status_; | |
| 357 NextProto negotiated_protocol_; | 350 NextProto negotiated_protocol_; |
| 358 // Protocol negotiation extension used. | |
| 359 SSLNegotiationExtension negotiation_extension_; | |
| 360 // Written by the |channel_id_service_|. | 351 // Written by the |channel_id_service_|. |
| 361 std::unique_ptr<crypto::ECPrivateKey> channel_id_key_; | 352 std::unique_ptr<crypto::ECPrivateKey> channel_id_key_; |
| 362 // True if a channel ID was sent. | 353 // True if a channel ID was sent. |
| 363 bool channel_id_sent_; | 354 bool channel_id_sent_; |
| 364 // If non-null, the newly-established to be inserted into the session cache | 355 // If non-null, the newly-established to be inserted into the session cache |
| 365 // once certificate verification is done. | 356 // once certificate verification is done. |
| 366 ScopedSSL_SESSION pending_session_; | 357 ScopedSSL_SESSION pending_session_; |
| 367 // True if the initial handshake's certificate has been verified. | 358 // True if the initial handshake's certificate has been verified. |
| 368 bool certificate_verified_; | 359 bool certificate_verified_; |
| 369 // The request handle for |channel_id_service_|. | 360 // The request handle for |channel_id_service_|. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 384 // True if PKP is bypassed due to a local trust anchor. | 375 // True if PKP is bypassed due to a local trust anchor. |
| 385 bool pkp_bypassed_; | 376 bool pkp_bypassed_; |
| 386 | 377 |
| 387 BoundNetLog net_log_; | 378 BoundNetLog net_log_; |
| 388 base::WeakPtrFactory<SSLClientSocketImpl> weak_factory_; | 379 base::WeakPtrFactory<SSLClientSocketImpl> weak_factory_; |
| 389 }; | 380 }; |
| 390 | 381 |
| 391 } // namespace net | 382 } // namespace net |
| 392 | 383 |
| 393 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ | 384 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_IMPL_H_ |
| OLD | NEW |