16 const std::vector<Extension>& extensions,
18 for (
auto it = extensions.begin(); it != extensions.end(); ++it) {
19 if (it->extension_type == type) {
23 return extensions.end();
28 const std::vector<Extension>& extensions) {
30 if (it == extensions.end()) {
34 auto ret = getExtension<T>(cs);
36 throw std::runtime_error(
"didn't read entire extension");
57 const std::vector<Extension>& extensions) {
60 if (it == extensions.end()) {
62 if (it == extensions.end()) {
89 detail::readVector<uint16_t>(share.
identities, cs);
90 detail::readVector<uint16_t>(share.
binders, cs);
121 detail::readBuf<uint16_t>(cookie.
cookie, cs);
128 detail::readVector<uint8_t>(versions.
versions, cs);
142 detail::readVector<uint8_t>(modes.
modes, cs);
163 detail::readVector<uint16_t>(authorities.
authorities, cs);
170 detail::readVector<uint8_t>(cca.
algorithms, cs);
201 detail::writeVector<uint16_t>(share.
client_shares, appender);
233 detail::writeVector<uint16_t>(share.
identities, appender);
234 detail::writeVector<uint16_t>(share.
binders, appender);
280 detail::writeBuf<uint16_t>(cookie.
cookie, appender);
290 detail::writeVector<uint8_t>(versions.
versions, appender);
310 detail::writeVector<uint8_t>(modes.
modes, appender);
340 detail::writeVector<uint16_t>(authorities.
authorities, appender);
350 detail::writeVector<uint8_t>(cca.
algorithms, appender);
363 cursor.skip(identitiesLen);
366 if (cursor.totalLength() != binderLen) {
370 return sizeof(binderLen) + binderLen;
435 return readBuf<uint8_t>(out.
binder, cursor);
443 writeBuf<uint8_t>(binder.
binder, out);
451 return getBufSize<uint8_t>(binder.
binder);
459 return readBuf<uint8_t>(name.
name, cursor);
467 writeBuf<uint8_t>(name.
name, out);
475 return getBufSize<uint8_t>(name.
name);
485 size += readBuf<uint16_t>(name.
hostname, cursor);
495 writeBuf<uint16_t>(name.
hostname, out);
uint32_t obfuscated_ticket_age
size_t getSize(const PskIdentity &ident)
std::vector< Extension >::const_iterator findExtension(const std::vector< Extension > &extensions, ExtensionType type)
std::vector< PskBinder > binders
size_t getBinderLength(const ClientHello &chlo)
size_t getSize(const ServerName &name)
void write(const T &in, folly::io::Appender &appender)
uint32_t max_early_data_size
static const std::string chlo
static std::unique_ptr< IOBuf > create(std::size_t capacity)
PUSHMI_INLINE_VAR constexpr detail::share_fn< TN... > share
size_t read(ProtocolName &name, folly::io::Cursor &cursor)
size_t getSize(const DistinguishedName &dn)
KeyShareEntry server_share
constexpr detail::Map< Move > move
std::vector< PskKeyExchangeMode > modes
size_t getSize(const PskBinder &binder)
void write(const ServerName &name, folly::io::Appender &out)
void write(const DistinguishedName &dn, folly::io::Appender &out)
std::vector< NamedGroup > named_group_list
size_t read(PskIdentity &out, folly::io::Cursor &cursor)
size_t read(ServerName &name, folly::io::Cursor &cursor)
std::vector< KeyShareEntry > client_shares
folly::Optional< TokenBindingParameters > getExtension(const std::vector< Extension > &extensions)
size_t read(KeyShareEntry &out, folly::io::Cursor &cursor)
void write(const ProtocolName &name, folly::io::Appender &out)
constexpr auto size(C const &c) -> decltype(c.size())
ProtocolVersion selected_version
void write(const PskIdentity &ident, folly::io::Appender &out)
uint16_t selected_identity
size_t read(T &out, folly::io::Cursor &cursor)
size_t getSize(const ProtocolName &name)
size_t read(DistinguishedName &dn, folly::io::Cursor &cursor)
size_t read(PskBinder &out, folly::io::Cursor &cursor)
NamedGroup selected_group
std::vector< SignatureScheme > supported_signature_algorithms
constexpr detail::Sig< Sig > const sig
std::vector< Extension > extensions
std::vector< ProtocolVersion > versions
ExtensionType extension_type
void write(const PskBinder &binder, folly::io::Appender &out)
void write(const KeyShareEntry &share, folly::io::Appender &out)
std::vector< ProtocolName > protocol_name_list
std::vector< PskIdentity > identities
std::vector< DistinguishedName > authorities
Extension encodeExtension(const TokenBindingParameters ¶ms)
size_t getSize(const KeyShareEntry &share)
std::vector< CertificateCompressionAlgorithm > algorithms
std::vector< ServerName > server_name_list