proxygen
FizzClient-inl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 namespace fizz {
10 namespace client {
11 
12 template <typename ActionMoveVisitor, typename SM>
14  std::shared_ptr<const FizzClientContext> context,
15  std::shared_ptr<const CertificateVerifier> verifier,
18  const std::shared_ptr<ClientExtensions>& extensions) {
19  this->addProcessingActions(this->machine_.processConnect(
20  this->state_,
21  std::move(context),
22  std::move(verifier),
23  std::move(sni),
24  std::move(cachedPsk),
25  extensions));
26 }
27 
28 template <typename ActionMoveVisitor, typename SM>
30  std::shared_ptr<const FizzClientContext> context,
32  const auto pskIdentity = hostname;
33  connect(
34  std::move(context),
35  std::make_shared<DefaultCertificateVerifier>(VerificationContext::Client),
36  std::move(hostname),
37  std::move(pskIdentity));
38 }
39 
40 template <typename ActionMoveVisitor, typename SM>
43  const Buf& context,
44  uint16_t length) const {
45  if (!this->state_.earlyDataParams()) {
46  throw std::runtime_error("early ekm not available");
47  }
48  return Exporter::getEkm(
49  this->state_.earlyDataParams()->cipher,
50  this->state_.earlyDataParams()->earlyExporterSecret->coalesce(),
51  label,
52  context ? context->clone() : nullptr,
53  length);
54 }
55 
56 template <typename ActionMoveVisitor, typename SM>
58  this->processActions(std::move(actions));
59 }
60 } // namespace client
61 } // namespace fizz
int connect(NetworkSocket s, const sockaddr *name, socklen_t namelen)
Definition: NetOps.cpp:94
context
Definition: CMakeCache.txt:563
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Buf getEarlyEkm(folly::StringPiece label, const Buf &context, uint16_t length) const
void startActions(Actions actions)
void connect(std::shared_ptr< const FizzClientContext > context, std::shared_ptr< const CertificateVerifier > verifier, folly::Optional< std::string > sni, folly::Optional< CachedPsk > cachedPsk, const std::shared_ptr< ClientExtensions > &extensions=nullptr)
std::vector< Action > Actions
Definition: Actions.h:81
Definition: Actions.h:16
Actions actions(Args &&...act)
Definition: Actions.h:86
StringPiece sni
static Buf getEkm(CipherSuite cipher, folly::ByteRange exporterMaster, folly::StringPiece label, Buf context, uint16_t length)
Definition: Exporter.cpp:13
std::unique_ptr< folly::IOBuf > Buf
Definition: Types.h:22
StringPiece label