Add ECH server config API to ssl_ctx_api fuzzer

Bug: 275
Change-Id: I4ccf7e8385d708326c71a855585583908e82bb2d
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/46744
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
grpc-202302
Dan McArdle 4 years ago committed by CQ bot account: commit-bot@chromium.org
parent 3af88549c2
commit 2de33c6b2b
  1. 19
      fuzz/ssl_ctx_api.cc

@ -491,6 +491,25 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
}
SSL_CTX_set1_sigalgs_list(ctx, sigalgs.c_str());
},
[](SSL_CTX *ctx, CBS *cbs) {
bssl::UniquePtr<SSL_ECH_SERVER_CONFIG_LIST> config_list(
SSL_ECH_SERVER_CONFIG_LIST_new());
if (config_list == nullptr) {
return;
}
uint8_t is_retry_config;
CBS ech_config, private_key;
if (!CBS_get_u8(cbs, &is_retry_config) ||
!CBS_get_u16_length_prefixed(cbs, &ech_config) ||
!CBS_get_u16_length_prefixed(cbs, &private_key)) {
return;
}
SSL_ECH_SERVER_CONFIG_LIST_add(
config_list.get(), is_retry_config, CBS_data(&ech_config),
CBS_len(&ech_config), CBS_data(&private_key),
CBS_len(&private_key));
SSL_CTX_set1_ech_server_config_list(ctx, config_list.get());
},
};
bssl::UniquePtr<SSL_CTX> ctx(SSL_CTX_new(TLS_method()));

Loading…
Cancel
Save