unplugged-system/external/cronet/net/test/ssl_test_util.h

29 lines
863 B
C++

// 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_