19 template <
typename Type>
26 auto aead = factory.
makeAead(cipher);
28 scheduler.
getTrafficKey(secret, aead->keyLength(), aead->ivLength());
30 recordLayer.setAead(secret,
std::move(aead));
41 return encodedFinished;
52 const std::vector<ExtensionType>& requestedExtensions) {
55 switch (ext.extension_type) {
64 "unexpected extension in ee: " +
toString(ext.extension_type),
68 requestedExtensions.begin(),
69 requestedExtensions.end(),
70 ext.extension_type) == requestedExtensions.end()) {
72 "unexpected extension in ee: " +
toString(ext.extension_type),
83 const std::vector<ExtensionType>& requestedExtensions) {
86 requestedExtensions.begin(),
87 requestedExtensions.end(),
88 ext.extension_type) == requestedExtensions.end() ||
94 "unexpected extension in shlo: " +
toString(ext.extension_type),
110 "unexpected extension in hrr: " +
toString(ext.extension_type),
118 std::vector<ExtensionType> extensionList;
119 for (
const auto& extension : exts) {
120 extensionList.push_back(extension.extension_type);
122 std::sort(extensionList.begin(), extensionList.end());
123 if (std::unique(extensionList.begin(), extensionList.end()) !=
124 extensionList.end()) {
std::vector< Extension > extensions
std::vector< Extension > extensions
static void setAead(Type &recordLayer, CipherSuite cipher, folly::ByteRange secret, const Factory &factory, const KeyScheduler &scheduler)
Buf encodeHandshake(T &&handshakeMsg)
KeyUpdateRequest request_update
folly::StringPiece toString(StateEnum state)
static Buf getFinished(folly::ByteRange handshakeWriteSecret, HandshakeContext &handshakeContext)
virtual TrafficKey getTrafficKey(folly::ByteRange trafficSecret, size_t keyLength, size_t ivLength) const
virtual void appendToTranscript(const Buf &transcript)=0
virtual Buf getFinishedData(folly::ByteRange baseKey) const =0
constexpr detail::Map< Move > move
virtual std::unique_ptr< Aead > makeAead(CipherSuite cipher) const
std::shared_ptr< folly::FunctionScheduler > scheduler
static void checkDuplicateExtensions(const std::vector< Extension > &exts)
static void checkAllowedExtensions(const EncryptedExtensions &ee, const std::vector< ExtensionType > &requestedExtensions)
std::vector< Extension > extensions
std::unique_ptr< folly::IOBuf > Buf
static void checkAllowedExtensions(const ServerHello &shlo, const std::vector< ExtensionType > &requestedExtensions)
static constexpr StringPiece secret
static void checkAllowedExtensions(const HelloRetryRequest &hrr)
static Buf getKeyUpdated(KeyUpdateRequest request_update)