OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_NSS_H_ | 5 #ifndef NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
6 #define NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ | 6 #define NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
7 | 7 |
8 // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424 | 8 // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=455424 |
9 // until NSS 3.12.2 comes out and we update to it. | 9 // until NSS 3.12.2 comes out and we update to it. |
10 #define Lock FOO_NSS_Lock | 10 #define Lock FOO_NSS_Lock |
11 #include <certt.h> | 11 #include <certt.h> |
12 #undef Lock | 12 #undef Lock |
13 #include <keyt.h> | 13 #include <keyt.h> |
14 #include <nspr.h> | 14 #include <nspr.h> |
15 #include <nss.h> | 15 #include <nss.h> |
16 | 16 |
17 #include <string> | 17 #include <string> |
| 18 #include <vector> |
18 | 19 |
19 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
20 #include "net/base/cert_verify_result.h" | 21 #include "net/base/cert_verify_result.h" |
21 #include "net/base/completion_callback.h" | 22 #include "net/base/completion_callback.h" |
22 #include "net/base/nss_memio.h" | 23 #include "net/base/nss_memio.h" |
23 #include "net/base/ssl_config_service.h" | 24 #include "net/base/ssl_config_service.h" |
24 #include "net/socket/ssl_client_socket.h" | 25 #include "net/socket/ssl_client_socket.h" |
25 | 26 |
26 namespace net { | 27 namespace net { |
27 | 28 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // Used by Write function. | 120 // Used by Write function. |
120 scoped_refptr<IOBuffer> user_write_buf_; | 121 scoped_refptr<IOBuffer> user_write_buf_; |
121 int user_write_buf_len_; | 122 int user_write_buf_len_; |
122 | 123 |
123 // Set when handshake finishes. | 124 // Set when handshake finishes. |
124 scoped_refptr<X509Certificate> server_cert_; | 125 scoped_refptr<X509Certificate> server_cert_; |
125 CertVerifyResult server_cert_verify_result_; | 126 CertVerifyResult server_cert_verify_result_; |
126 | 127 |
127 // Stores client authentication information between ClientAuthHandler and | 128 // Stores client authentication information between ClientAuthHandler and |
128 // GetSSLCertRequestInfo calls. | 129 // GetSSLCertRequestInfo calls. |
129 CERTDistNames* client_auth_ca_names_; | 130 std::vector<scoped_refptr<X509Certificate> > client_certs_; |
130 bool client_auth_cert_needed_; | 131 bool client_auth_cert_needed_; |
131 | 132 |
132 scoped_ptr<CertVerifier> verifier_; | 133 scoped_ptr<CertVerifier> verifier_; |
133 | 134 |
134 bool completed_handshake_; | 135 bool completed_handshake_; |
135 | 136 |
136 enum State { | 137 enum State { |
137 STATE_NONE, | 138 STATE_NONE, |
138 STATE_HANDSHAKE, | 139 STATE_HANDSHAKE, |
139 STATE_VERIFY_CERT, | 140 STATE_VERIFY_CERT, |
140 STATE_VERIFY_CERT_COMPLETE, | 141 STATE_VERIFY_CERT_COMPLETE, |
141 }; | 142 }; |
142 State next_handshake_state_; | 143 State next_handshake_state_; |
143 | 144 |
144 // The NSS SSL state machine | 145 // The NSS SSL state machine |
145 PRFileDesc* nss_fd_; | 146 PRFileDesc* nss_fd_; |
146 | 147 |
147 // Buffers for the network end of the SSL state machine | 148 // Buffers for the network end of the SSL state machine |
148 memio_Private* nss_bufs_; | 149 memio_Private* nss_bufs_; |
149 | 150 |
150 static bool nss_options_initialized_; | 151 static bool nss_options_initialized_; |
151 }; | 152 }; |
152 | 153 |
153 } // namespace net | 154 } // namespace net |
154 | 155 |
155 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ | 156 #endif // NET_SOCKET_SSL_CLIENT_SOCKET_NSS_H_ |
OLD | NEW |