curl-fuzzer C++ reference
Loading...
Searching...
No Matches
pop3s_mock_server.cc
Go to the documentation of this file.
1/*
2 * Copyright (C) Max Dymond, <cmeister2@gmail.com>, et al.
3 *
4 * SPDX-License-Identifier: curl
5 */
6
9
11
12#include <cstddef>
13#include <memory>
14#include <string>
15
17
18namespace proto_fuzzer {
19
24
28
34void Pop3sMockServer::Install(CURL* easy) {
36 transport_.Install(easy);
37}
38
42std::unique_ptr<MockConnection> Pop3sMockServer::CreateConnection() { return transport_.CreateConnection(); }
43
45int Pop3sMockServer::negotiated_tls_version() const { return transport_.negotiated_tls_version(); }
46
48std::size_t Pop3sMockServer::completed_handshake_count() const { return transport_.completed_handshake_count(); }
49
51std::string Pop3sMockServer::negotiated_alpn() const { return transport_.negotiated_alpn(); }
52
55#if defined(PROTO_FUZZER_OBSERVE_STATE)
57 const volatile std::size_t pop3s_observation[] = {
58 completed_handshake_count(), static_cast<std::size_t>(negotiated_tls_version()), negotiated_alpn().size()};
59 (void)pop3s_observation;
60#endif
61}
62
63} // namespace proto_fuzzer
virtual void Install(CURL *easy)
Install the common OPENSOCKETFUNCTION / OPENSOCKETDATA / SOCKOPTFUNCTION callbacks on 'easy'.
std::unique_ptr< MockConnection > connection_
The per-scenario MockConnection, lazily created by HandleOpenSocket().
void ObserveState() override
Retain protocol outcomes in coverage and introspector builds.
void Install(CURL *easy) override
Install the shared socket callbacks and a stable local trust anchor.
~Pop3sMockServer() override
Release the TLS connection before the carrier-owned server context.
std::size_t completed_handshake_count() const
Pop3sMockServer()
Construct the OpenSSL server carrier used by every POP3S scenario.
void ObserveState() override
Retain protocol outcomes in coverage and introspector builds.
std::unique_ptr< MockConnection > CreateConnection() override
Wrap one socketpair endpoint in an OpenSSL acceptor.
std::string negotiated_alpn() const
MockConnection and MockServer — the in-process peer that feeds canned response bytes to libcurl over ...
Implicit-TLS in-process peer for curl's POP3S state machine.
TlsApplicationProtocol
Application protocol selected by the in-process TLS peer.
@ kHttp11
Ordinary HTTPS scripts contain HTTP/1.1 response bytes.