diff options
author | Dan McArdle <dmcardle@google.com> | 2021-04-12 12:15:51 -0400 |
---|---|---|
committer | CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> | 2021-04-12 22:58:40 +0000 |
commit | 2de33c6b2bd882c58bfccec6617df775caeb76af (patch) | |
tree | 2ad5654bd7d8465a9d581742245d9e5ab7030966 /fuzz | |
parent | 3af88549c2d985f51b019f87be21f47463a27421 (diff) | |
download | boringssl-2de33c6b2bd882c58bfccec6617df775caeb76af.zip boringssl-2de33c6b2bd882c58bfccec6617df775caeb76af.tar.gz boringssl-2de33c6b2bd882c58bfccec6617df775caeb76af.tar.bz2 |
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>
Diffstat (limited to 'fuzz')
-rw-r--r-- | fuzz/ssl_ctx_api.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/fuzz/ssl_ctx_api.cc b/fuzz/ssl_ctx_api.cc index abf2f16..08b3e6f 100644 --- a/fuzz/ssl_ctx_api.cc +++ b/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())); |