xref: /aosp_15_r20/external/cronet/net/test/ssl_test_util.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_TEST_SSL_TEST_UTIL_H_
6 #define NET_TEST_SSL_TEST_UTIL_H_
7 
8 #include <cstddef>
9 #include <cstdint>
10 #include <string_view>
11 #include <vector>
12 
13 #include "third_party/boringssl/src/include/openssl/ssl.h"
14 
15 namespace net {
16 
17 // Generates new ECH keys and ECHConfig with the specified public name and
18 // maximum name length. Returns an `SSL_ECH_KEYS` structure on success or
19 // `nullptr` on error. On success, sets `*ech_config_list` to an ECHConfigList
20 // containing the generated ECHConfig.
21 bssl::UniquePtr<SSL_ECH_KEYS> MakeTestEchKeys(
22     std::string_view public_name,
23     size_t max_name_len,
24     std::vector<uint8_t>* ech_config_list);
25 
26 }  // namespace net
27 
28 #endif  // NET_TEST_SSL_TEST_UTIL_H_
29