Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: net/socket/ssl_client_socket_openssl.h

Issue 5528003: Add support for OpenSSL Next Protocol Negotiation (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #pragma once 7 #pragma once
8 8
9 #include <string>
10
9 #include "base/scoped_ptr.h" 11 #include "base/scoped_ptr.h"
10 #include "net/base/cert_verify_result.h" 12 #include "net/base/cert_verify_result.h"
11 #include "net/base/completion_callback.h" 13 #include "net/base/completion_callback.h"
12 #include "net/base/io_buffer.h" 14 #include "net/base/io_buffer.h"
13 #include "net/base/ssl_config_service.h" 15 #include "net/base/ssl_config_service.h"
14 #include "net/socket/ssl_client_socket.h" 16 #include "net/socket/ssl_client_socket.h"
15 #include "net/socket/client_socket_handle.h" 17 #include "net/socket/client_socket_handle.h"
16 18
17 typedef struct bio_st BIO; 19 typedef struct bio_st BIO;
18 typedef struct evp_pkey_st EVP_PKEY; 20 typedef struct evp_pkey_st EVP_PKEY;
(...skipping 18 matching lines...) Expand all
37 const HostPortPair& host_and_port, 39 const HostPortPair& host_and_port,
38 const SSLConfig& ssl_config); 40 const SSLConfig& ssl_config);
39 ~SSLClientSocketOpenSSL(); 41 ~SSLClientSocketOpenSSL();
40 42
41 const HostPortPair& host_and_port() const { return host_and_port_; } 43 const HostPortPair& host_and_port() const { return host_and_port_; }
42 44
43 // Callback from the SSL layer that indicates the remote server is requesting 45 // Callback from the SSL layer that indicates the remote server is requesting
44 // a certificate for this client. 46 // a certificate for this client.
45 int ClientCertRequestCallback(SSL* ssl, X509** x509, EVP_PKEY** pkey); 47 int ClientCertRequestCallback(SSL* ssl, X509** x509, EVP_PKEY** pkey);
46 48
49 // Callback from the SSL layer to check which NPN protocol we are supporting
50 int SelectNextProtoCallback(unsigned char** out, unsigned char* outlen,
51 const unsigned char* in, unsigned int inlen);
52
47 // SSLClientSocket methods: 53 // SSLClientSocket methods:
48 virtual void GetSSLInfo(SSLInfo* ssl_info); 54 virtual void GetSSLInfo(SSLInfo* ssl_info);
49 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); 55 virtual void GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info);
50 virtual NextProtoStatus GetNextProto(std::string* proto); 56 virtual NextProtoStatus GetNextProto(std::string* proto);
51 57
52 // ClientSocket methods: 58 // ClientSocket methods:
53 virtual int Connect(CompletionCallback* callback); 59 virtual int Connect(CompletionCallback* callback);
54 virtual void Disconnect(); 60 virtual void Disconnect();
55 virtual bool IsConnected() const; 61 virtual bool IsConnected() const;
56 virtual bool IsConnectedAndIdle() const; 62 virtual bool IsConnectedAndIdle() const;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // Used for session cache diagnostics. 145 // Used for session cache diagnostics.
140 bool trying_cached_session_; 146 bool trying_cached_session_;
141 147
142 enum State { 148 enum State {
143 STATE_NONE, 149 STATE_NONE,
144 STATE_HANDSHAKE, 150 STATE_HANDSHAKE,
145 STATE_VERIFY_CERT, 151 STATE_VERIFY_CERT,
146 STATE_VERIFY_CERT_COMPLETE, 152 STATE_VERIFY_CERT_COMPLETE,
147 }; 153 };
148 State next_handshake_state_; 154 State next_handshake_state_;
155 NextProtoStatus npn_status_;
156 std::string npn_proto_;
149 BoundNetLog net_log_; 157 BoundNetLog net_log_;
150 }; 158 };
151 159
152 } // namespace net 160 } // namespace net
153 161
154 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_ 162 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_OPENSSL_H_
155 163
OLDNEW
« no previous file with comments | « no previous file | net/socket/ssl_client_socket_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698