curl-fuzzer C++ reference
Loading...
Searching...
No Matches
option_model.cc File Reference

Generated option semantics without curl execution or handle state. More...

Go to the source code of this file.

Functions

std::uint64_t proto_fuzzer::DecodeIntegralOptionValue (const OptionDescriptor &descriptor, const curl::fuzzer::proto::SetOption &option)
 Decode using an already-resolved descriptor, avoiding another lookup when the runtime has selected the option's application path.
const OptionDescriptor * proto_fuzzer::LookupOptionDescriptor (curl::fuzzer::proto::CurlOptionId id)
 Return the generated description, or nullptr for an unsupported option.
bool proto_fuzzer::UsesInMemoryPublicKeyPin (const std::string &value)
 Whether curl will interpret this pin as an in-memory digest expression.
void proto_fuzzer::ConstrainPinnedPublicKeyValue (std::string *value)
 Prefix filename-like pins with in-memory digest syntax.
std::uint64_t proto_fuzzer::DecodeIntegralOptionValue (const curl::fuzzer::proto::SetOption &option)
 Decode a recognized integral option.
void proto_fuzzer::CanonicalizeOptionValueCases (curl::fuzzer::proto::Scenario *scenario)
 Restore each recognized option's consumed oneof member without calling libcurl.

Detailed Description

Generated option semantics without curl execution or handle state.

Definition in file option_model.cc.

Function Documentation

◆ CanonicalizeOptionValueCases()

void proto_fuzzer::CanonicalizeOptionValueCases ( curl::fuzzer::proto::Scenario * scenario)

Restore each recognized option's consumed oneof member without calling libcurl.

Public-key pins are constrained to curl's in-memory digest syntax. Unknown ids remain available for later mutation into a supported option.

Parameters
scenarioScenario to canonicalize in place; nullptr is harmless.

Definition at line 83 of file option_model.cc.

◆ ConstrainPinnedPublicKeyValue()

void proto_fuzzer::ConstrainPinnedPublicKeyValue ( std::string * value)

Prefix filename-like pins with in-memory digest syntax.

This helper does not trim bytes; fixed-target normalization applies its final budget after canonicalization, while compatibility execution preserves its input size.

Parameters
valuePin expression to constrain in place; nullptr is harmless.

Definition at line 64 of file option_model.cc.

◆ DecodeIntegralOptionValue() [1/2]

std::uint64_t proto_fuzzer::DecodeIntegralOptionValue ( const curl::fuzzer::proto::SetOption & option)

Decode a recognized integral option.

Numeric options preserve magnitude; boolean options use truthiness. Incompatible or unknown values yield zero.

Parameters
optionStructured option whose descriptor and value will be read.
Returns
Descriptor-aware integral value, or zero for incompatible values.

Definition at line 74 of file option_model.cc.

◆ DecodeIntegralOptionValue() [2/2]

std::uint64_t proto_fuzzer::DecodeIntegralOptionValue ( const OptionDescriptor & descriptor,
const curl::fuzzer::proto::SetOption & option )

Decode using an already-resolved descriptor, avoiding another lookup when the runtime has selected the option's application path.

Parameters
descriptorGenerated description of the option being decoded.
optionStructured option supplying the integral value.
Returns
Integral value interpreted according to the descriptor's family.

Definition at line 31 of file option_model.cc.

◆ LookupOptionDescriptor()

const OptionDescriptor * proto_fuzzer::LookupOptionDescriptor ( curl::fuzzer::proto::CurlOptionId id)

Return the generated description, or nullptr for an unsupported option.

Parameters
idProtobuf option identifier to look up.
Returns
Immutable generated descriptor, or nullptr when unsupported.

Definition at line 51 of file option_model.cc.

◆ UsesInMemoryPublicKeyPin()

bool proto_fuzzer::UsesInMemoryPublicKeyPin ( const std::string & value)

Whether curl will interpret this pin as an in-memory digest expression.

Parameters
valuePublic-key pin expression to inspect.
Returns
True when the value begins with curl's in-memory digest prefix.

Definition at line 58 of file option_model.cc.