proxygen
fizz::server::test::AeadCookieCipherTest Class Reference
Inheritance diagram for fizz::server::test::AeadCookieCipherTest:
testing::Test

Public Member Functions

void SetUp () override
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
virtual ~Test ()
 
virtual ~Test ()
 

Protected Member Functions

Buf getClientHello (Buf cookie)
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 

Protected Attributes

std::shared_ptr< FizzServerContextcontext_
 
std::shared_ptr< AES128CookieCiphercipher_
 

Additional Inherited Members

- Public Types inherited from testing::Test
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc
 
typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 
static void SetUpTestCase ()
 
static void TearDownTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 

Detailed Description

Definition at line 40 of file AeadCookieCipherTest.cpp.

Member Function Documentation

Buf fizz::server::test::AeadCookieCipherTest::getClientHello ( Buf  cookie)
inlineprotected

Definition at line 54 of file AeadCookieCipherTest.cpp.

References c, chlo, fizz::test::TestMessages::clientHello(), fizz::Cookie::cookie, fizz::TLSContent::data, fizz::encodeExtension(), fizz::encodeHandshake(), folly::gen::move, and fizz::PlaintextWriteRecordLayer::writeInitialClientHello().

54  {
55  auto chlo = TestMessages::clientHello();
56 
57  if (cookie) {
58  Cookie c;
59  c.cookie = std::move(cookie);
60  chlo.extensions.push_back(encodeExtension(std::move(c)));
61  }
62 
63  return PlaintextWriteRecordLayer()
64  .writeInitialClientHello(encodeHandshake(std::move(chlo)))
65  .data;
66  }
Buf encodeHandshake(T &&handshakeMsg)
Definition: Types-inl.h:515
static const std::string chlo
StringPiece cookie
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
Extension encodeExtension(const TokenBindingParameters &params)
Definition: Types.cpp:113
char c
void fizz::server::test::AeadCookieCipherTest::SetUp ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 42 of file AeadCookieCipherTest.cpp.

References EXPECT_TRUE, folly::gen::move, s, secret, fizz::tls_1_3, and fizz::test::toIOBuf().

42  {
43  context_ = std::make_shared<FizzServerContext>();
44  context_->setSupportedVersions({ProtocolVersion::tls_1_3});
45  cipher_ = std::make_shared<AES128CookieCipher>();
46  cipher_->setContext(context_.get());
47 
48  auto s = toIOBuf(secret);
49  std::vector<ByteRange> cookieSecrets{{s->coalesce()}};
50  EXPECT_TRUE(cipher_->setCookieSecrets(std::move(cookieSecrets)));
51  }
std::unique_ptr< folly::IOBuf > toIOBuf(std::string hexData)
std::shared_ptr< AES128CookieCipher > cipher_
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::shared_ptr< FizzServerContext > context_
#define EXPECT_TRUE(condition)
Definition: gtest.h:1859
static set< string > s
static constexpr StringPiece secret

Member Data Documentation

std::shared_ptr<AES128CookieCipher> fizz::server::test::AeadCookieCipherTest::cipher_
protected

Definition at line 69 of file AeadCookieCipherTest.cpp.

std::shared_ptr<FizzServerContext> fizz::server::test::AeadCookieCipherTest::context_
protected

Definition at line 68 of file AeadCookieCipherTest.cpp.


The documentation for this class was generated from the following file: