| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_BASE_SSL_CLIENT_SOCKET_NSS_H_ | 5 #ifndef NET_BASE_SSL_CLIENT_SOCKET_NSS_H_ |
| 6 #define NET_BASE_SSL_CLIENT_SOCKET_NSS_H_ | 6 #define NET_BASE_SSL_CLIENT_SOCKET_NSS_H_ |
| 7 | 7 |
| 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. |
| 10 #define Lock FOO_NSS_Lock |
| 11 #include <certt.h> |
| 12 #undef Lock |
| 8 #include <nspr.h> | 13 #include <nspr.h> |
| 9 #include <nss.h> | 14 #include <nss.h> |
| 10 #include <string> | 15 #include <string> |
| 11 | 16 |
| 12 #include "base/scoped_ptr.h" | 17 #include "base/scoped_ptr.h" |
| 13 #include "net/base/completion_callback.h" | 18 #include "net/base/completion_callback.h" |
| 14 #include "net/base/nss_memio.h" | 19 #include "net/base/nss_memio.h" |
| 15 #include "net/base/ssl_client_socket.h" | 20 #include "net/base/ssl_client_socket.h" |
| 16 #include "net/base/ssl_config_service.h" | 21 #include "net/base/ssl_config_service.h" |
| 17 | 22 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 88 |
| 84 // Used by both Read and Write functions. | 89 // Used by both Read and Write functions. |
| 85 scoped_refptr<IOBuffer> user_buf_; | 90 scoped_refptr<IOBuffer> user_buf_; |
| 86 int user_buf_len_; | 91 int user_buf_len_; |
| 87 | 92 |
| 88 // Set when handshake finishes. Value is net error code, see net_errors.h | 93 // Set when handshake finishes. Value is net error code, see net_errors.h |
| 89 int server_cert_error_; | 94 int server_cert_error_; |
| 90 | 95 |
| 91 // Set during handshake. | 96 // Set during handshake. |
| 92 scoped_refptr<X509Certificate> server_cert_; | 97 scoped_refptr<X509Certificate> server_cert_; |
| 98 // Certificate chain. |
| 99 CERTCertList* cert_list_; |
| 93 | 100 |
| 94 bool completed_handshake_; | 101 bool completed_handshake_; |
| 95 | 102 |
| 96 enum State { | 103 enum State { |
| 97 STATE_NONE, | 104 STATE_NONE, |
| 98 STATE_HANDSHAKE_READ, | 105 STATE_HANDSHAKE_READ, |
| 99 // No STATE_HANDSHAKE_READ_COMPLETE needed, go to STATE_NONE instead. | 106 // No STATE_HANDSHAKE_READ_COMPLETE needed, go to STATE_NONE instead. |
| 100 STATE_PAYLOAD_WRITE, | 107 STATE_PAYLOAD_WRITE, |
| 101 STATE_PAYLOAD_READ, | 108 STATE_PAYLOAD_READ, |
| 102 }; | 109 }; |
| 103 State next_state_; | 110 State next_state_; |
| 104 | 111 |
| 105 // The NSS SSL state machine | 112 // The NSS SSL state machine |
| 106 PRFileDesc* nss_fd_; | 113 PRFileDesc* nss_fd_; |
| 107 | 114 |
| 108 // Buffers for the network end of the SSL state machine | 115 // Buffers for the network end of the SSL state machine |
| 109 memio_Private* nss_bufs_; | 116 memio_Private* nss_bufs_; |
| 110 | 117 |
| 111 static bool nss_options_initialized_; | 118 static bool nss_options_initialized_; |
| 112 }; | 119 }; |
| 113 | 120 |
| 114 } // namespace net | 121 } // namespace net |
| 115 | 122 |
| 116 #endif // NET_BASE_SSL_CLIENT_SOCKET_NSS_H_ | 123 #endif // NET_BASE_SSL_CLIENT_SOCKET_NSS_H_ |
| OLD | NEW |