proxygen
fizz::client Namespace Reference

Namespaces

 detail
 
 test
 

Classes

class  AsyncFizzClientT
 
class  BasicPskCache
 
struct  CachedPsk
 
class  ClientStateMachine
 
struct  ClientTypes
 
struct  EarlyDataParams
 
class  FizzClient
 
class  FizzClientContext
 
struct  NewCachedPsk
 
class  PskCache
 
struct  ReportEarlyHandshakeSuccess
 
struct  ReportEarlyWriteFailed
 
struct  ReportHandshakeSuccess
 
class  State
 
class  SynchronizedLruPskCache
 

Typedefs

using MutateState = folly::Function< void(State &)>
 
using Action = boost::variant< DeliverAppData, WriteToSocket, ReportHandshakeSuccess, ReportEarlyHandshakeSuccess, ReportEarlyWriteFailed, ReportError, MutateState, WaitForData, NewCachedPsk >
 
using Actions = std::vector< Action >
 
using AsyncFizzClient = AsyncFizzClientT< ClientStateMachine >
 

Enumerations

enum  EarlyDataRejectionPolicy { EarlyDataRejectionPolicy::FatalConnectionError, EarlyDataRejectionPolicy::AutomaticResend }
 
enum  StateEnum {
  StateEnum::Uninitialized, StateEnum::ExpectingServerHello, StateEnum::ExpectingEncryptedExtensions, StateEnum::ExpectingCertificate,
  StateEnum::ExpectingCertificateVerify, StateEnum::ExpectingFinished, StateEnum::Established, StateEnum::Error,
  StateEnum::NUM_STATES
}
 
enum  ClientAuthType { ClientAuthType::NotRequested, ClientAuthType::Sent, ClientAuthType::RequestedNoMatch, ClientAuthType::Stored }
 

Functions

static bool certIdentityMatch (const Cert *a, const Cert *b)
 
bool earlyParametersMatch (const State &state)
 
std::ostream & operator<< (std::ostream &os, StateEnum state)
 
std::ostream & operator<< (std::ostream &os, ClientAuthType auth)
 

Typedef Documentation

using fizz::client::Actions = typedef std::vector<Action>

Definition at line 81 of file Actions.h.

A lambda that should be invoked on State so that modification can be applied.

Definition at line 24 of file Actions.h.

Enumeration Type Documentation

States for client authentication:

  • NotRequested: server did not request client auth
  • Sent: server requested client auth and a matching certificate was found
  • RequestedNoMatch: server requested client auth but no matching certificate was found
  • Stored: client used PSK auth, PSK has an associated client certificate
Enumerator
NotRequested 
Sent 
RequestedNoMatch 
Stored 

Definition at line 42 of file State.h.

Enumerator
FatalConnectionError 

Treat early data rejection as a fatal error. An EARLY_DATA_REJECTED AsyncSocketException will be delivered to the read callback.

AutomaticResend 

Automatically resend early data as normal data. Will only be done if the following connection parameters match what was used for early data:

Definition at line 16 of file EarlyDataRejectionPolicy.h.

Function Documentation

static bool fizz::client::certIdentityMatch ( const Cert a,
const Cert b 
)
static

Definition at line 14 of file EarlyDataRejectionPolicy.cpp.

References b, and folly::AsyncTransportCertificate::getIdentity().

Referenced by earlyParametersMatch().

14  {
15  if (!a || !b) {
16  return a == b;
17  }
18 
19  return a->getIdentity() == b->getIdentity();
20 }
char b
char a
bool fizz::client::earlyParametersMatch ( const State state)

Definition at line 22 of file EarlyDataRejectionPolicy.cpp.

References fizz::client::State::alpn(), certIdentityMatch(), fizz::client::State::cipher(), fizz::client::State::clientCert(), fizz::client::State::earlyDataParams(), fizz::client::State::serverCert(), and fizz::client::State::version().

Referenced by fizz::client::AsyncFizzClientT< SM >::handleEarlyReject().

22  {
23  if (*state.version() != state.earlyDataParams()->version) {
24  return false;
25  }
26 
27  if (*state.cipher() != state.earlyDataParams()->cipher) {
28  return false;
29  }
30 
31  if (state.alpn() != state.earlyDataParams()->alpn) {
32  return false;
33  }
34 
35  if (!certIdentityMatch(
36  state.serverCert().get(),
37  state.earlyDataParams()->serverCert.get())) {
38  return false;
39  }
40 
41  if (!certIdentityMatch(
42  state.clientCert().get(),
43  state.earlyDataParams()->clientCert.get())) {
44  return false;
45  }
46 
47  return true;
48 }
static bool certIdentityMatch(const Cert *a, const Cert *b)
state
Definition: http_parser.c:272
std::ostream& fizz::client::operator<< ( std::ostream &  os,
StateEnum  state 
)
inline

Definition at line 560 of file State.h.

References fizz::toString().

560  {
561  os << toString(state);
562  return os;
563 }
folly::StringPiece toString(server::StateEnum state)
state
Definition: http_parser.c:272
std::ostream& fizz::client::operator<< ( std::ostream &  os,
ClientAuthType  auth 
)
inline

Definition at line 565 of file State.h.

References fizz::toString().

565  {
566  os << toString(auth);
567  return os;
568 }
folly::StringPiece toString(server::StateEnum state)