14namespace proto_fuzzer {
20TlsGroupPolicy GroupPolicyFor(curl::fuzzer::proto::TlsGroupProfile profile) {
31 curl::fuzzer::proto::TlsGroupProfile group_profile)
34H2OriginMockServer::~H2OriginMockServer() {
37 retained_multi_.reset();
49 (void)curl_easy_setopt(easy, CURLOPT_SSL_EC_CURVES,
"X25519");
51 (void)curl_easy_setopt(easy, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2TLS);
52 (void)curl_easy_setopt(easy, CURLOPT_UPKEEP_INTERVAL_MS, 0L);
68 runtime_.PrepareMulti(multi, scenario.accept_h2_push());
69 if (!scenario.has_http2_plan()) {
73 runtime_.ResetPlan(scenario.http2_plan(),
"https");
77 runtime_.ApplyPostHeadersTransition(easy);
H2OriginMockServer(curl::fuzzer::proto::TlsCertificateChainProfile certificate_chain=curl::fuzzer::proto::TLS_CERTIFICATE_CHAIN_DEFAULT_EC, curl::fuzzer::proto::TlsGroupProfile group_profile=curl::fuzzer::proto::TLS_GROUP_X25519)
Construct an HTTP/2 TLS peer with the selected certificate chain.
const H2Runtime & runtime() const
Expose shared protocol observations without allowing carrier state changes.
void RunLoop(CURLM *multi, CURL *easy, const curl::fuzzer::proto::Scenario &scenario) override
Run the raw HTTP/2 response driver and probe server push and upkeep APIs.
void HandleDetachedMulti(CurlMultiPtr multi) override
Keep the connection cache alive until this mock is destroyed, after the caller has cleaned the detach...
std::size_t cleaned_push_count() const
void Install(CURL *easy) override
Keep transport selection out of the mutation grammar.
std::unique_ptr< MockConnection > CreateConnection() override
Attach the reusable H2 client-frame tracker after TLS decryption.
Protocol state shared by TLS and plaintext HTTP/2 origin peers.
std::size_t additional_handle_cleanup_count() const
MockConnection * connection()
static constexpr int kMaxDriveIterations
Hard operation budget for one scenario.
void ResumeResponseIfRequested(CURL *easy)
Resume receive-side callback output at one bounded drive boundary when the dedicated API plan request...
static constexpr int kMaxIdleIterations
Consecutive no-progress budget for ordinary scenarios.
void ResetConnections()
Release all current and retired socketpairs before resetting transport- specific state.
void RunLoop(CURLM *multi, CURL *easy, const curl::fuzzer::proto::Scenario &scenario) override
Seed the mock from the scenario, then drive the perform loop until curl is done or a deterministic op...
void SetScripts(const curl::fuzzer::proto::Scenario &scenario)
Build the complete borrowed script table before entering curl.
void Install(CURL *easy) override
Install common socket callbacks and a stable local trust anchor.
TlsMockServer()
Build one reusable in-process server context per fuzz iteration.
TlsGroupPolicy group_policy() const
void ObserveActiveTransfer(CURL *easy) override
Query while the connection filters are attached.
std::unique_ptr< MockConnection > CreateConnection() override
Wrap one socketpair server endpoint in an OpenSSL acceptor consumed by MockServer.
std::unique_ptr< CURLM, CurlMultiDeleter > CurlMultiPtr
Unique ownership of a CURL multi handle.
HTTPS origin peer with a fixed HTTP/2 application protocol.
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.