summaryrefslogtreecommitdiff
path: root/chromium/net/test/ssl_test_util.h
blob: c78bef954c549c76be1683e078c2fd0ec9da6663 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_TEST_SSL_TEST_UTIL_H_
#define NET_TEST_SSL_TEST_UTIL_H_

#include <cstddef>
#include <cstdint>
#include <vector>

#include "base/strings/string_piece.h"
#include "third_party/boringssl/src/include/openssl/ssl.h"

namespace net {

// Generates new ECH keys and ECHConfig with the specified public name and
// maximum name length. Returns an `SSL_ECH_KEYS` structure on success or
// `nullptr` on error. On success, sets `*ech_config_list` to an ECHConfigList
// containing the generated ECHConfig.
bssl::UniquePtr<SSL_ECH_KEYS> MakeTestEchKeys(
    base::StringPiece public_name,
    size_t max_name_len,
    std::vector<uint8_t>* ech_config_list);

}  // namespace net

#endif  // NET_TEST_SSL_TEST_UTIL_H_