Go to the documentation of this file.
30 "-out-ech-config-list",
32 "The path where the ECHConfigList should be written.",
37 "The path where the ECHConfig should be written.",
42 "The path where the private key should be written.",
47 "The public name for the new ECHConfig.",
52 "The config ID for the new ECHConfig, from 0 to 255. Config IDs may be "
53 "reused, but should be unique among active configs on a server for "
59 "The length of the longest name in the anonymity set, to guide client "
70 std::map<std::string, std::string> args_map;
77 if (!
GetUnsigned(&config_id,
"-config-id", 0, args_map) ||
79 fprintf(
stderr,
"Error parsing -config-id argument\n");
83 unsigned max_name_len = 0;
84 if (args_map.count(
"-max-name-length") != 0 &&
85 !
GetUnsigned(&max_name_len,
"-max-name-length", 0, args_map)) {
86 fprintf(
stderr,
"Error parsing -max-name-length argument\n");
93 size_t public_key_len, private_key_len;
99 fprintf(
stderr,
"Failed to generate the HPKE keypair\n");
104 size_t ech_config_len;
106 &ech_config, &ech_config_len,
static_cast<uint8_t>(config_id),
107 key.get(), args_map[
"-public-name"].c_str(),
size_t{max_name_len})) {
108 fprintf(
stderr,
"Failed to serialize the ECHConfigList\n");
111 bssl::UniquePtr<uint8_t> free_ech_config(ech_config);
119 fprintf(
stderr,
"Failed to serialize the ECHConfigList\n");
123 args_map[
"-out-ech-config-list"],
129 fprintf(
stderr,
"Failed to write ECHConfig or private key to file\n");
bool ParseKeyValueArguments(std::map< std::string, std::string > *out_args, const std::vector< std::string > &args, const struct argument *templates)
#define EVP_HPKE_KEY_private_key
#define CBB_add_u16_length_prefixed
#define EVP_HPKE_KEY_public_key
#define EVP_HPKE_MAX_PRIVATE_KEY_LENGTH
#define SSL_marshal_ech_config
static const struct argument kArguments[]
void PrintUsage(const struct argument *templates)
bool GetUnsigned(unsigned *out, const std::string &arg_name, unsigned default_value, const std::map< std::string, std::string > &args)
bool GenerateECH(const std::vector< std::string > &args)
#define EVP_hpke_x25519_hkdf_sha256
#define EVP_HPKE_KEY_generate
internal::StackAllocated< EVP_HPKE_KEY, void, EVP_HPKE_KEY_zero, EVP_HPKE_KEY_cleanup > ScopedEVP_HPKE_KEY
#define EVP_HPKE_MAX_PUBLIC_KEY_LENGTH
constexpr Span< const T > MakeConstSpan(T *ptr, size_t size) noexcept
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:59:23