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_SOCKET_H_ | 5 #ifndef NET_SOCKET_SSL_SOCKET_H_ |
6 #define NET_SOCKET_SSL_SOCKET_H_ | 6 #define NET_SOCKET_SSL_SOCKET_H_ |
7 | 7 |
8 #include "base/basictypes.h" | |
9 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
10 #include "net/socket/stream_socket.h" | 9 #include "net/socket/stream_socket.h" |
11 | 10 |
12 namespace net { | 11 namespace net { |
13 | 12 |
14 // SSLSocket interface defines method that are common between client | 13 // SSLSocket interface defines method that are common between client |
15 // and server SSL sockets. | 14 // and server SSL sockets. |
16 class NET_EXPORT SSLSocket : public StreamSocket { | 15 class NET_EXPORT SSLSocket : public StreamSocket { |
17 public: | 16 public: |
18 ~SSLSocket() override {} | 17 ~SSLSocket() override {} |
19 | 18 |
20 // Exports data derived from the SSL master-secret (see RFC 5705). | 19 // Exports data derived from the SSL master-secret (see RFC 5705). |
21 // If |has_context| is false, uses the no-context construction from the | 20 // If |has_context| is false, uses the no-context construction from the |
22 // RFC and |context| is ignored. The call will fail with an error if | 21 // RFC and |context| is ignored. The call will fail with an error if |
23 // the socket is not connected or the SSL implementation does not | 22 // the socket is not connected or the SSL implementation does not |
24 // support the operation. | 23 // support the operation. |
25 virtual int ExportKeyingMaterial(const base::StringPiece& label, | 24 virtual int ExportKeyingMaterial(const base::StringPiece& label, |
26 bool has_context, | 25 bool has_context, |
27 const base::StringPiece& context, | 26 const base::StringPiece& context, |
28 unsigned char* out, | 27 unsigned char* out, |
29 unsigned int outlen) = 0; | 28 unsigned int outlen) = 0; |
30 | 29 |
31 // Stores the the tls-unique channel binding (see RFC 5929) in |*out|. | 30 // Stores the the tls-unique channel binding (see RFC 5929) in |*out|. |
32 virtual int GetTLSUniqueChannelBinding(std::string* out) = 0; | 31 virtual int GetTLSUniqueChannelBinding(std::string* out) = 0; |
33 }; | 32 }; |
34 | 33 |
35 } // namespace net | 34 } // namespace net |
36 | 35 |
37 #endif // NET_SOCKET_SSL_SOCKET_H_ | 36 #endif // NET_SOCKET_SSL_SOCKET_H_ |
OLD | NEW |