blob: 7bea4226d6b968a64357e1b2e3fffb25faad5d82 [file] [log] [blame]
Avi Drissman64595482022-09-14 20:52:291// Copyright 2012 The Chromium Authors
[email protected]b70a4a22011-11-15 03:12:332// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef NET_SOCKET_SSL_SOCKET_H_
6#define NET_SOCKET_SSL_SOCKET_H_
7
[email protected]d069c11a2013-04-13 00:01:558#include "base/strings/string_piece.h"
bnc81c46c1f2016-10-04 16:25:599#include "net/base/net_export.h"
[email protected]b70a4a22011-11-15 03:12:3310#include "net/socket/stream_socket.h"
11
[email protected]b70a4a22011-11-15 03:12:3312namespace net {
13
14// SSLSocket interface defines method that are common between client
15// and server SSL sockets.
16class NET_EXPORT SSLSocket : public StreamSocket {
17public:
Tsuyoshi Horo07c3f0e2022-06-16 07:30:4718 ~SSLSocket() override = default;
[email protected]b70a4a22011-11-15 03:12:3319
Tsuyoshi Horo07c3f0e2022-06-16 07:30:4720 // Exports data derived from the SSL master-secret (see RFC 5705).
21 // 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
23 // the socket is not connected or the SSL implementation does not
24 // support the operation.
David Benjaminb6c2dd162022-10-24 10:46:0625 virtual int ExportKeyingMaterial(base::StringPiece label,
Tsuyoshi Horo07c3f0e2022-06-16 07:30:4726 bool has_context,
David Benjaminb6c2dd162022-10-24 10:46:0627 base::StringPiece context,
Tsuyoshi Horo07c3f0e2022-06-16 07:30:4728 unsigned char* out,
29 unsigned int outlen) = 0;
[email protected]b70a4a22011-11-15 03:12:3330};
31
32} // namespace net
33
34#endif // NET_SOCKET_SSL_SOCKET_H_