| 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> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 namespace net { | 21 namespace net { |
| 22 | 22 |
| 23 class SSLServerSocketNSS : public SSLServerSocket { | 23 class SSLServerSocketNSS : public SSLServerSocket { |
| 24 public: | 24 public: |
| 25 // See comments on CreateSSLServerSocket for details of how these | 25 // See comments on CreateSSLServerSocket for details of how these |
| 26 // parameters are used. | 26 // parameters are used. |
| 27 SSLServerSocketNSS(scoped_ptr<StreamSocket> socket, | 27 SSLServerSocketNSS(scoped_ptr<StreamSocket> socket, |
| 28 scoped_refptr<X509Certificate> certificate, | 28 scoped_refptr<X509Certificate> certificate, |
| 29 crypto::RSAPrivateKey* key, | 29 crypto::RSAPrivateKey* key, |
| 30 const SSLConfig& ssl_config); | 30 const SSLConfig& ssl_config); |
| 31 virtual ~SSLServerSocketNSS(); | 31 ~SSLServerSocketNSS() override; |
| 32 | 32 |
| 33 // SSLServerSocket interface. | 33 // SSLServerSocket interface. |
| 34 virtual int Handshake(const CompletionCallback& callback) override; | 34 int Handshake(const CompletionCallback& callback) override; |
| 35 | 35 |
| 36 // SSLSocket interface. | 36 // SSLSocket interface. |
| 37 virtual int ExportKeyingMaterial(const base::StringPiece& label, | 37 int ExportKeyingMaterial(const base::StringPiece& label, |
| 38 bool has_context, | 38 bool has_context, |
| 39 const base::StringPiece& context, | 39 const base::StringPiece& context, |
| 40 unsigned char* out, | 40 unsigned char* out, |
| 41 unsigned int outlen) override; | 41 unsigned int outlen) override; |
| 42 virtual int GetTLSUniqueChannelBinding(std::string* out) override; | 42 int GetTLSUniqueChannelBinding(std::string* out) override; |
| 43 | 43 |
| 44 // Socket interface (via StreamSocket). | 44 // Socket interface (via StreamSocket). |
| 45 virtual int Read(IOBuffer* buf, int buf_len, | 45 int Read(IOBuffer* buf, |
| 46 const CompletionCallback& callback) override; | 46 int buf_len, |
| 47 virtual int Write(IOBuffer* buf, int buf_len, | 47 const CompletionCallback& callback) override; |
| 48 const CompletionCallback& callback) override; | 48 int Write(IOBuffer* buf, |
| 49 virtual int SetReceiveBufferSize(int32 size) override; | 49 int buf_len, |
| 50 virtual int SetSendBufferSize(int32 size) override; | 50 const CompletionCallback& callback) override; |
| 51 int SetReceiveBufferSize(int32 size) override; |
| 52 int SetSendBufferSize(int32 size) override; |
| 51 | 53 |
| 52 // StreamSocket implementation. | 54 // StreamSocket implementation. |
| 53 virtual int Connect(const CompletionCallback& callback) override; | 55 int Connect(const CompletionCallback& callback) override; |
| 54 virtual void Disconnect() override; | 56 void Disconnect() override; |
| 55 virtual bool IsConnected() const override; | 57 bool IsConnected() const override; |
| 56 virtual bool IsConnectedAndIdle() const override; | 58 bool IsConnectedAndIdle() const override; |
| 57 virtual int GetPeerAddress(IPEndPoint* address) const override; | 59 int GetPeerAddress(IPEndPoint* address) const override; |
| 58 virtual int GetLocalAddress(IPEndPoint* address) const override; | 60 int GetLocalAddress(IPEndPoint* address) const override; |
| 59 virtual const BoundNetLog& NetLog() const override; | 61 const BoundNetLog& NetLog() const override; |
| 60 virtual void SetSubresourceSpeculation() override; | 62 void SetSubresourceSpeculation() override; |
| 61 virtual void SetOmniboxSpeculation() override; | 63 void SetOmniboxSpeculation() override; |
| 62 virtual bool WasEverUsed() const override; | 64 bool WasEverUsed() const override; |
| 63 virtual bool UsingTCPFastOpen() const override; | 65 bool UsingTCPFastOpen() const override; |
| 64 virtual bool WasNpnNegotiated() const override; | 66 bool WasNpnNegotiated() const override; |
| 65 virtual NextProto GetNegotiatedProtocol() const override; | 67 NextProto GetNegotiatedProtocol() const override; |
| 66 virtual bool GetSSLInfo(SSLInfo* ssl_info) override; | 68 bool GetSSLInfo(SSLInfo* ssl_info) override; |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 enum State { | 71 enum State { |
| 70 STATE_NONE, | 72 STATE_NONE, |
| 71 STATE_HANDSHAKE, | 73 STATE_HANDSHAKE, |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 int InitializeSSLOptions(); | 76 int InitializeSSLOptions(); |
| 75 | 77 |
| 76 void OnSendComplete(int result); | 78 void OnSendComplete(int result); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 143 |
| 142 State next_handshake_state_; | 144 State next_handshake_state_; |
| 143 bool completed_handshake_; | 145 bool completed_handshake_; |
| 144 | 146 |
| 145 DISALLOW_COPY_AND_ASSIGN(SSLServerSocketNSS); | 147 DISALLOW_COPY_AND_ASSIGN(SSLServerSocketNSS); |
| 146 }; | 148 }; |
| 147 | 149 |
| 148 } // namespace net | 150 } // namespace net |
| 149 | 151 |
| 150 #endif // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ | 152 #endif // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ |
| OLD | NEW |