14namespace proto_fuzzer {
21#include "curl_fuzzer_option_manifest.inc"
32 const curl::fuzzer::proto::SetOption& option) {
36 switch (option.value_case()) {
37 case curl::fuzzer::proto::SetOption::kBoolValue:
38 return option.bool_value() ? 1U : 0U;
39 case curl::fuzzer::proto::SetOption::kUintValue:
41 case curl::fuzzer::proto::SetOption::kStringValue:
42 case curl::fuzzer::proto::SetOption::VALUE_NOT_SET:
52 return generated::LookupOptionDescriptor(
id);
66 value->insert(0,
"sha256//");
84 if (scenario ==
nullptr) {
87 for (
auto& option : *scenario->mutable_options()) {
89 if (descriptor ==
nullptr) {
92 switch (descriptor->
kind) {
94 if (option.value_case() != curl::fuzzer::proto::SetOption::kStringValue) {
95 option.set_string_value(
"");
97 if (descriptor->
id == curl::fuzzer::proto::CURLOPT_PINNEDPUBLICKEY) {
102 if (option.value_case() != curl::fuzzer::proto::SetOption::kUintValue) {
107 if (option.value_case() != curl::fuzzer::proto::SetOption::kBoolValue) {
void ConstrainPinnedPublicKeyValue(std::string *value)
Prefix filename-like pins with in-memory digest syntax.
bool UsesInMemoryPublicKeyPin(const std::string &value)
Whether curl will interpret this pin as an in-memory digest expression.
const OptionDescriptor * LookupOptionDescriptor(curl::fuzzer::proto::CurlOptionId id)
Return the generated description, or nullptr for an unsupported option.
std::uint64_t DecodeIntegralOptionValue(const OptionDescriptor &descriptor, const curl::fuzzer::proto::SetOption &option)
Decode using an already-resolved descriptor, avoiding another lookup when the runtime has selected th...
void CanonicalizeOptionValueCases(curl::fuzzer::proto::Scenario *scenario)
Restore each recognized option's consumed oneof member without calling libcurl.
Pure interpretation and normalization of structured curl options.
@ kBool
bool_value passed as a zero-or-one long flag.
@ kString
string_value passed to a string or byte-data option.
@ kUint
uint_value passed to a long or curl_off_t option.
A generated option description.
OptionValueKind kind
Value family consumed by the native option.
curl::fuzzer::proto::CurlOptionId id
Stable protobuf identifier for this option.