diff --git a/third-party/fizz/src/fizz/protocol/ech/Types.h b/third-party/fizz/src/fizz/protocol/ech/Types.h index 8cec14923d3d0d..1d1f8e57c43628 100644 --- a/third-party/fizz/src/fizz/protocol/ech/Types.h +++ b/third-party/fizz/src/fizz/protocol/ech/Types.h @@ -41,6 +41,33 @@ struct HpkeKeyConfig { hpke::KEMId kem_id; HpkePublicKey public_key; std::vector cipher_suites; + + HpkeKeyConfig() {} + HpkeKeyConfig(const HpkeKeyConfig& other) { + config_id = other.config_id; + kem_id = other.kem_id; + public_key = other.public_key->clone(); + cipher_suites = other.cipher_suites; + } + HpkeKeyConfig(HpkeKeyConfig&& other) = default; + HpkeKeyConfig& operator=(const HpkeKeyConfig&& other) { + if (this != &other) { + config_id = other.config_id; + kem_id = other.kem_id; + public_key = other.public_key->clone(); + cipher_suites = other.cipher_suites; + } + return *this; + } + HpkeKeyConfig& operator=(const HpkeKeyConfig& other) { + if (this != &other) { + config_id = other.config_id; + kem_id = other.kem_id; + public_key = other.public_key->clone(); + cipher_suites = other.cipher_suites; + } + return *this; + } }; struct ECHConfigContentDraft { @@ -48,6 +75,40 @@ struct ECHConfigContentDraft { uint8_t maximum_name_length; Buf public_name; std::vector extensions; + + ECHConfigContentDraft() {} + ECHConfigContentDraft(const ECHConfigContentDraft& other) { + key_config = other.key_config; + maximum_name_length = other.maximum_name_length; + public_name = other.public_name->clone(); + extensions = std::vector(); + for (const auto& extension : other.extensions) + extensions.push_back(extension.clone()); + } + ECHConfigContentDraft(ECHConfigContentDraft&& other) = default; + ECHConfigContentDraft& operator=(ECHConfigContentDraft&& other) { + if (this != &other) { + key_config = other.key_config; + maximum_name_length = other.maximum_name_length; + public_name = std::move(other.public_name); + extensions = std::vector(); + for (const auto& extension : other.extensions) + extensions.push_back(extension.clone()); + } + return *this; + } + + ECHConfigContentDraft& operator=(const ECHConfigContentDraft& other) { + if (this != &other) { + key_config = other.key_config; + maximum_name_length = other.maximum_name_length; + public_name = other.public_name->clone(); + extensions = std::vector(); + for (const auto& extension : other.extensions) + extensions.push_back(extension.clone()); + } + return *this; + } }; struct ECHConfig {