| 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_SERVER_SOCKET_NSS_H_ | 5 #ifndef NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ | 
| 6 #define NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ | 6 #define NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ | 
| 7 | 7 | 
| 8 #include <certt.h> | 8 #include <certt.h> | 
| 9 #include <keyt.h> | 9 #include <keyt.h> | 
| 10 #include <nspr.h> | 10 #include <nspr.h> | 
| 11 #include <nss.h> | 11 #include <nss.h> | 
| 12 #include <stdint.h> | 12 #include <stdint.h> | 
| 13 | 13 | 
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" | 
| 15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" | 
| 16 #include "net/base/host_port_pair.h" | 16 #include "net/base/host_port_pair.h" | 
| 17 #include "net/base/nss_memio.h" | 17 #include "net/base/nss_memio.h" | 
| 18 #include "net/log/net_log.h" | 18 #include "net/log/net_log.h" | 
| 19 #include "net/socket/ssl_server_socket.h" | 19 #include "net/socket/ssl_server_socket.h" | 
| 20 #include "net/ssl/ssl_server_config.h" | 20 #include "net/ssl/ssl_config_service.h" | 
| 21 | 21 | 
| 22 namespace net { | 22 namespace net { | 
| 23 | 23 | 
| 24 class SSLServerSocketNSS : public SSLServerSocket { | 24 class SSLServerSocketNSS : public SSLServerSocket { | 
| 25  public: | 25  public: | 
| 26   // See comments on CreateSSLServerSocket for details of how these | 26   // See comments on CreateSSLServerSocket for details of how these | 
| 27   // parameters are used. | 27   // parameters are used. | 
| 28   SSLServerSocketNSS(scoped_ptr<StreamSocket> socket, | 28   SSLServerSocketNSS(scoped_ptr<StreamSocket> socket, | 
| 29                      scoped_refptr<X509Certificate> certificate, | 29                      scoped_refptr<X509Certificate> certificate, | 
| 30                      crypto::RSAPrivateKey* key, | 30                      crypto::RSAPrivateKey* key, | 
| 31                      const SSLServerConfig& ssl_config); | 31                      const SSLConfig& ssl_config); | 
| 32   ~SSLServerSocketNSS() override; | 32   ~SSLServerSocketNSS() override; | 
| 33 | 33 | 
| 34   // SSLServerSocket interface. | 34   // SSLServerSocket interface. | 
| 35   int Handshake(const CompletionCallback& callback) override; | 35   int Handshake(const CompletionCallback& callback) override; | 
| 36 | 36 | 
| 37   // SSLSocket interface. | 37   // SSLSocket interface. | 
| 38   int ExportKeyingMaterial(const base::StringPiece& label, | 38   int ExportKeyingMaterial(const base::StringPiece& label, | 
| 39                            bool has_context, | 39                            bool has_context, | 
| 40                            const base::StringPiece& context, | 40                            const base::StringPiece& context, | 
| 41                            unsigned char* out, | 41                            unsigned char* out, | 
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 131   // The NSS SSL state machine | 131   // The NSS SSL state machine | 
| 132   PRFileDesc* nss_fd_; | 132   PRFileDesc* nss_fd_; | 
| 133 | 133 | 
| 134   // Buffers for the network end of the SSL state machine | 134   // Buffers for the network end of the SSL state machine | 
| 135   memio_Private* nss_bufs_; | 135   memio_Private* nss_bufs_; | 
| 136 | 136 | 
| 137   // StreamSocket for sending and receiving data. | 137   // StreamSocket for sending and receiving data. | 
| 138   scoped_ptr<StreamSocket> transport_socket_; | 138   scoped_ptr<StreamSocket> transport_socket_; | 
| 139 | 139 | 
| 140   // Options for the SSL socket. | 140   // Options for the SSL socket. | 
| 141   SSLServerConfig ssl_config_; | 141   SSLConfig ssl_config_; | 
| 142 | 142 | 
| 143   // Certificate for the server. | 143   // Certificate for the server. | 
| 144   scoped_refptr<X509Certificate> cert_; | 144   scoped_refptr<X509Certificate> cert_; | 
| 145 | 145 | 
| 146   // Private key used by the server. | 146   // Private key used by the server. | 
| 147   scoped_ptr<crypto::RSAPrivateKey> key_; | 147   scoped_ptr<crypto::RSAPrivateKey> key_; | 
| 148 | 148 | 
| 149   State next_handshake_state_; | 149   State next_handshake_state_; | 
| 150   bool completed_handshake_; | 150   bool completed_handshake_; | 
| 151 | 151 | 
| 152   DISALLOW_COPY_AND_ASSIGN(SSLServerSocketNSS); | 152   DISALLOW_COPY_AND_ASSIGN(SSLServerSocketNSS); | 
| 153 }; | 153 }; | 
| 154 | 154 | 
| 155 }  // namespace net | 155 }  // namespace net | 
| 156 | 156 | 
| 157 #endif  // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ | 157 #endif  // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ | 
| OLD | NEW | 
|---|