#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/webrtc/fake_ssl_client_socket.h"
#include <stddef.h>
#include <stdint.h>
#include <cstdlib>
#include <cstring>
#include <string_view>
#include <utility>
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/logging.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
namespace webrtc {
namespace {
static const uint8_t kSslClientHello[] = …;
static const uint8_t kSslServerHello[] = …;
constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation = …;
scoped_refptr<net::DrainableIOBuffer> NewDrainableIOBufferWithSize(int size) { … }
}
std::string_view FakeSSLClientSocket::GetSslClientHello() { … }
std::string_view FakeSSLClientSocket::GetSslServerHello() { … }
FakeSSLClientSocket::FakeSSLClientSocket(
std::unique_ptr<net::StreamSocket> transport_socket)
: … { … }
FakeSSLClientSocket::~FakeSSLClientSocket() { … }
int FakeSSLClientSocket::Read(net::IOBuffer* buf,
int buf_len,
net::CompletionOnceCallback callback) { … }
int FakeSSLClientSocket::ReadIfReady(net::IOBuffer* buf,
int buf_len,
net::CompletionOnceCallback callback) { … }
int FakeSSLClientSocket::CancelReadIfReady() { … }
int FakeSSLClientSocket::Write(
net::IOBuffer* buf,
int buf_len,
net::CompletionOnceCallback callback,
const net::NetworkTrafficAnnotationTag& traffic_annotation) { … }
int FakeSSLClientSocket::SetReceiveBufferSize(int32_t size) { … }
int FakeSSLClientSocket::SetSendBufferSize(int32_t size) { … }
int FakeSSLClientSocket::Connect(net::CompletionOnceCallback callback) { … }
int FakeSSLClientSocket::DoHandshakeLoop() { … }
void FakeSSLClientSocket::RunUserConnectCallback(int status) { … }
void FakeSSLClientSocket::DoHandshakeLoopWithUserConnectCallback() { … }
int FakeSSLClientSocket::DoConnect() { … }
void FakeSSLClientSocket::OnConnectDone(int status) { … }
void FakeSSLClientSocket::ProcessConnectDone() { … }
int FakeSSLClientSocket::DoSendClientHello() { … }
void FakeSSLClientSocket::OnSendClientHelloDone(int status) { … }
void FakeSSLClientSocket::ProcessSendClientHelloDone(size_t written) { … }
int FakeSSLClientSocket::DoVerifyServerHello() { … }
void FakeSSLClientSocket::OnVerifyServerHelloDone(int status) { … }
net::Error FakeSSLClientSocket::ProcessVerifyServerHelloDone(size_t read) { … }
void FakeSSLClientSocket::Disconnect() { … }
bool FakeSSLClientSocket::IsConnected() const { … }
bool FakeSSLClientSocket::IsConnectedAndIdle() const { … }
int FakeSSLClientSocket::GetPeerAddress(net::IPEndPoint* address) const { … }
int FakeSSLClientSocket::GetLocalAddress(net::IPEndPoint* address) const { … }
const net::NetLogWithSource& FakeSSLClientSocket::NetLog() const { … }
bool FakeSSLClientSocket::WasEverUsed() const { … }
net::NextProto FakeSSLClientSocket::GetNegotiatedProtocol() const { … }
bool FakeSSLClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) { … }
int64_t FakeSSLClientSocket::GetTotalReceivedBytes() const { … }
void FakeSSLClientSocket::ApplySocketTag(const net::SocketTag& tag) { … }
}