23 Buf encodedHelloRetryRequest;
48 const std::vector<NamedGroup>& supportedGroups,
50 auto groupsExt = getExtension<SupportedGroups>(chlo.
extensions);
57 auto negotiatedGroup =
58 negotiate(supportedGroups, groupsExt->named_group_list);
59 if (!negotiatedGroup) {
64 auto clientShares = getExtension<ClientKeyShare>(chlo.
extensions);
66 throw std::runtime_error(
"supported_groups without key_share");
69 for (
const auto&
share : clientShares->client_shares) {
70 if (
share.group == *negotiatedGroup) {
76 return negotiatedGroup;
81 const std::vector<ProtocolVersion>& supportedVersions,
82 const std::vector<std::vector<CipherSuite>>& supportedCiphers,
83 const std::vector<NamedGroup>& supportedGroups,
86 auto clientVersions = getExtension<SupportedVersions>(chlo.
extensions);
87 if (!clientVersions) {
88 throw std::runtime_error(
"no supported versions");
92 throw std::runtime_error(
"version mismatch");
97 throw std::runtime_error(
"cipher mismatch");
110 state.
chloHash = handshakeContext->getHandshakeContext();
std::vector< Extension > extensions
Buf getStatelessHelloRetryRequest(ProtocolVersion version, CipherSuite cipher, folly::Optional< NamedGroup > group, Buf cookie)
Buf encodeHandshake(T &&handshakeMsg)
static const std::string chlo
static std::unique_ptr< IOBuf > create(std::size_t capacity)
PUSHMI_INLINE_VAR constexpr detail::share_fn< TN... > share
CookieState getCookieState(const Factory &factory, const std::vector< ProtocolVersion > &supportedVersions, const std::vector< std::vector< CipherSuite >> &supportedCiphers, const std::vector< NamedGroup > &supportedGroups, const ClientHello &chlo, Buf appToken)
folly::Optional< T > negotiate(const std::vector< std::vector< T >> &serverPref, const std::vector< T > &clientPref)
constexpr detail::Map< Move > move
static folly::Optional< NamedGroup > getHrrGroup(const std::vector< NamedGroup > &supportedGroups, const ClientHello &chlo)
Buf legacy_session_id_echo
ProtocolVersion selected_version
NamedGroup selected_group
virtual std::unique_ptr< HandshakeContext > makeHandshakeContext(CipherSuite cipher) const
std::vector< Extension > extensions
std::vector< CipherSuite > cipher_suites
ProtocolVersion legacy_version
Optional< NamedGroup > group
folly::Optional< Buf > originalEncoding
std::unique_ptr< folly::IOBuf > Buf
folly::Optional< NamedGroup > group
Extension encodeExtension(const TokenBindingParameters ¶ms)