10#ifndef PROTO_FUZZER_TLS_MOCK_SERVER_H_
11#define PROTO_FUZZER_TLS_MOCK_SERVER_H_
19namespace proto_fuzzer {
43class TlsServerContext;
53 curl::fuzzer::proto::TlsCertificateChainProfile certificate_chain =
54 curl::fuzzer::proto::TLS_CERTIFICATE_CHAIN_DEFAULT_EC,
56 curl::fuzzer::proto::TlsHandshakeProfile handshake_profile = curl::fuzzer::proto::TLS_HANDSHAKE_DEFAULT);
81 const bool openssl_close_notify_;
82 const bool openssl_hello_request_;
83 std::unique_ptr<TlsServerContext> context_;
94 curl::fuzzer::proto::TlsCertificateChainProfile certificate_chain,
95 curl::fuzzer::proto::TlsHandshakeProfile handshake_profile = curl::fuzzer::proto::TLS_HANDSHAKE_DEFAULT);
101 void Install(CURL* easy)
override;
130 curl::fuzzer::proto::TlsCertificateChainProfile certificate_chain =
131 curl::fuzzer::proto::TLS_CERTIFICATE_CHAIN_DEFAULT_EC,
133 curl::fuzzer::proto::TlsHandshakeProfile handshake_profile = curl::fuzzer::proto::TLS_HANDSHAKE_DEFAULT);
143 bool saw_live_tls_session_;
144 std::size_t session_export_attempt_count_;
145 std::size_t exported_session_count_;
146 std::size_t imported_session_count_;
MockServer(MultiDrivePolicy drive_policy=MultiDrivePolicy::kPerform)
Construct an idle MockServer with no scripted responses or open peers.
void Install(CURL *easy) override
Install common socket callbacks and a stable local trust anchor.
int negotiated_tls_version() const
std::string ech_inner_name() const
std::size_t reused_session_count() const
std::size_t imported_session_count() const
std::size_t exported_session_count() const
std::string negotiated_alpn() const
TlsMockServer()
Build one reusable in-process server context per fuzz iteration.
std::size_t completed_handshake_count() const
TlsGroupPolicy group_policy() const
~TlsMockServer() override
Release SSL objects before their owning server context.
std::string negotiated_group() const
void ObserveActiveTransfer(CURL *easy) override
Query while the connection filters are attached.
bool saw_live_tls_session() const
std::size_t write_retry_count() const
std::unique_ptr< MockConnection > CreateConnection() override
Wrap one socketpair server endpoint in an OpenSSL acceptor consumed by MockServer.
std::string ech_outer_name() const
Reusable TLS carrier for protocol-specific mock peers.
std::unique_ptr< MockConnection > CreateConnection()
Wrap one socketpair server endpoint in an OpenSSL acceptor.
std::unique_ptr< MockConnection > CreateAcceptedConnection(int accepted_fd)
Wrap one accepted loopback descriptor in this transport's OpenSSL server context.
std::size_t completed_handshake_count() const
std::size_t reused_session_count() const
void Install(CURL *easy) const
Install the stable local trust anchor and strict peer verification.
int negotiated_tls_version() const
std::size_t write_retry_count() const
std::string ech_inner_name() const
TlsMockTransport(TlsApplicationProtocol protocol=TlsApplicationProtocol::kHttp11, curl::fuzzer::proto::TlsCertificateChainProfile certificate_chain=curl::fuzzer::proto::TLS_CERTIFICATE_CHAIN_DEFAULT_EC, TlsGroupPolicy group_policy=TlsGroupPolicy::kProviderDefault, curl::fuzzer::proto::TlsHandshakeProfile handshake_profile=curl::fuzzer::proto::TLS_HANDSHAKE_DEFAULT)
Construct one reusable TLS context for a protocol-specific peer.
std::string negotiated_alpn() const
TlsGroupPolicy group_policy() const
std::string ech_outer_name() const
std::string negotiated_group() const
MockConnection and MockServer — the in-process peer that feeds canned response bytes to libcurl over ...
TlsGroupPolicy
Key-exchange group policy fixed when a TLS peer is constructed.
@ kProviderDefault
Retain the linked OpenSSL provider's preferred group ordering.
@ kX25519
Restrict negotiation to the inexpensive X25519 group.
TlsApplicationProtocol
Application protocol selected by the in-process TLS peer.
@ kHttp2
The dedicated proxy peer exchanges HTTP/2 frames after its handshake.
@ kHttp11
Ordinary HTTPS scripts contain HTTP/1.1 response bytes.