| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <certt.h> | 9 #include <certt.h> |
| 10 #include <keyt.h> | 10 #include <keyt.h> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 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(StreamSocket* socket, | 28 SSLServerSocketNSS(StreamSocket* socket, |
| 29 scoped_refptr<X509Certificate> certificate, | 29 scoped_refptr<X509Certificate> certificate, |
| 30 crypto::RSAPrivateKey* key, | 30 crypto::RSAPrivateKey* key, |
| 31 const SSLConfig& ssl_config); | 31 const SSLConfig& ssl_config); |
| 32 virtual ~SSLServerSocketNSS(); | 32 virtual ~SSLServerSocketNSS(); |
| 33 | 33 |
| 34 // SSLServerSocket interface. | 34 // SSLServerSocket interface. |
| 35 virtual int Handshake(OldCompletionCallback* callback); | 35 virtual int Handshake(OldCompletionCallback* callback) OVERRIDE; |
| 36 virtual int ExportKeyingMaterial(const base::StringPiece& label, | 36 virtual int ExportKeyingMaterial(const base::StringPiece& label, |
| 37 const base::StringPiece& context, | 37 const base::StringPiece& context, |
| 38 unsigned char *out, | 38 unsigned char *out, |
| 39 unsigned int outlen); | 39 unsigned int outlen) OVERRIDE; |
| 40 | 40 |
| 41 // Socket interface (via StreamSocket). | 41 // Socket interface (via StreamSocket). |
| 42 virtual int Read(IOBuffer* buf, int buf_len, | 42 virtual int Read(IOBuffer* buf, int buf_len, |
| 43 OldCompletionCallback* callback); | 43 OldCompletionCallback* callback) OVERRIDE; |
| 44 virtual int Write(IOBuffer* buf, int buf_len, | 44 virtual int Write(IOBuffer* buf, int buf_len, |
| 45 OldCompletionCallback* callback); | 45 OldCompletionCallback* callback) OVERRIDE; |
| 46 virtual bool SetReceiveBufferSize(int32 size); | 46 virtual bool SetReceiveBufferSize(int32 size) OVERRIDE; |
| 47 virtual bool SetSendBufferSize(int32 size); | 47 virtual bool SetSendBufferSize(int32 size) OVERRIDE; |
| 48 | 48 |
| 49 // StreamSocket interface. | 49 // StreamSocket interface. |
| 50 virtual int Connect(OldCompletionCallback* callback); | 50 virtual int Connect(OldCompletionCallback* callback) OVERRIDE; |
| 51 virtual void Disconnect(); | 51 virtual void Disconnect() OVERRIDE; |
| 52 virtual bool IsConnected() const; | 52 virtual bool IsConnected() const OVERRIDE; |
| 53 virtual bool IsConnectedAndIdle() const; | 53 virtual bool IsConnectedAndIdle() const OVERRIDE; |
| 54 virtual int GetPeerAddress(AddressList* address) const; | 54 virtual int GetPeerAddress(AddressList* address) const OVERRIDE; |
| 55 virtual int GetLocalAddress(IPEndPoint* address) const; | 55 virtual int GetLocalAddress(IPEndPoint* address) const OVERRIDE; |
| 56 virtual const BoundNetLog& NetLog() const; | 56 virtual const BoundNetLog& NetLog() const OVERRIDE; |
| 57 virtual void SetSubresourceSpeculation(); | 57 virtual void SetSubresourceSpeculation() OVERRIDE; |
| 58 virtual void SetOmniboxSpeculation(); | 58 virtual void SetOmniboxSpeculation() OVERRIDE; |
| 59 virtual bool WasEverUsed() const; | 59 virtual bool WasEverUsed() const OVERRIDE; |
| 60 virtual bool UsingTCPFastOpen() const; | 60 virtual bool UsingTCPFastOpen() const OVERRIDE; |
| 61 virtual int64 NumBytesRead() const; | 61 virtual int64 NumBytesRead() const OVERRIDE; |
| 62 virtual base::TimeDelta GetConnectTimeMicros() const; | 62 virtual base::TimeDelta GetConnectTimeMicros() const OVERRIDE; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 enum State { | 65 enum State { |
| 66 STATE_NONE, | 66 STATE_NONE, |
| 67 STATE_HANDSHAKE, | 67 STATE_HANDSHAKE, |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 int InitializeSSLOptions(); | 70 int InitializeSSLOptions(); |
| 71 | 71 |
| 72 void OnSendComplete(int result); | 72 void OnSendComplete(int result); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 | 139 |
| 140 State next_handshake_state_; | 140 State next_handshake_state_; |
| 141 bool completed_handshake_; | 141 bool completed_handshake_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(SSLServerSocketNSS); | 143 DISALLOW_COPY_AND_ASSIGN(SSLServerSocketNSS); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 } // namespace net | 146 } // namespace net |
| 147 | 147 |
| 148 #endif // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ | 148 #endif // NET_SOCKET_SSL_SERVER_SOCKET_NSS_H_ |
| OLD | NEW |