proxygen
fizz::extensions::test::ValidatorTest Class Reference
Inheritance diagram for fizz::extensions::test::ValidatorTest:
testing::Test

Public Member Functions

void SetUp () override
 
TokenBinding setUpWithKeyParameters (TokenBindingKeyParameters params)
 
Buf getBuf (StringPiece hex)
 
- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
virtual ~Test ()
 
virtual ~Test ()
 

Public Attributes

Buf ekm_
 

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)
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 
 Test ()
 
virtual void TearDown ()
 

Detailed Description

Definition at line 34 of file ValidatorTest.cpp.

Member Function Documentation

Buf fizz::extensions::test::ValidatorTest::getBuf ( StringPiece  hex)
inline

Definition at line 59 of file ValidatorTest.cpp.

References folly::IOBuf::copyBuffer(), folly::data(), and folly::unhexlify().

59  {
60  auto data = unhexlify(hex);
61  return folly::IOBuf::copyBuffer(data.data(), data.size());
62  }
bool unhexlify(const InputString &input, OutputString &output)
Definition: String-inl.h:616
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)
Definition: IOBuf.h:1587
static constexpr uint64_t data[1]
Definition: Fingerprint.cpp:43
void fizz::extensions::test::ValidatorTest::SetUp ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 36 of file ValidatorTest.cpp.

References fizz::extensions::test::chrome_session_ekm.

36  {
37  OpenSSL_add_all_algorithms();
39  }
StringPiece chrome_session_ekm
TokenBinding fizz::extensions::test::ValidatorTest::setUpWithKeyParameters ( TokenBindingKeyParameters  params)
inline

Definition at line 41 of file ValidatorTest.cpp.

References fizz::extensions::test::chrome_session_key, fizz::extensions::test::chrome_session_signature, folly::IOBuf::create(), fizz::extensions::TokenBinding::extensions, fizz::extensions::TokenBindingID::key_parameters, folly::gen::move, params, fizz::extensions::TokenBinding::signature, tokenBinding, fizz::extensions::TokenBinding::tokenbinding_type, and fizz::extensions::TokenBinding::tokenbindingid.

41  {
42  TokenBinding tokenBinding;
43  tokenBinding.tokenbinding_type = TokenBindingType::provided_token_binding;
44  tokenBinding.extensions = folly::IOBuf::create(0);
45  TokenBindingID id;
46  id.key_parameters = params;
47  switch (params) {
49  id.key = getBuf(chrome_session_key);
50  tokenBinding.tokenbindingid = std::move(id);
51  tokenBinding.signature = getBuf(chrome_session_signature);
52  return tokenBinding;
53  }
54  default: // rsa_pss and rsa_pkcs
55  throw std::runtime_error("not implemented");
56  }
57  }
static std::unique_ptr< IOBuf > create(std::size_t capacity)
Definition: IOBuf.cpp:229
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
constexpr Params params[]
StringPiece tokenBinding
StringPiece chrome_session_signature
StringPiece chrome_session_key

Member Data Documentation

Buf fizz::extensions::test::ValidatorTest::ekm_

Definition at line 64 of file ValidatorTest.cpp.


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