proxygen
fizz::test::DefaultCertificateVerifierTest Class Reference
Inheritance diagram for fizz::test::DefaultCertificateVerifierTest:
testing::Test

Public Member Functions

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

Static Public Member Functions

static int allowSelfSignedLeafCertCallback (int ok, X509_STORE_CTX *ctx)
 
- 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 Attributes

CertAndKey rootCertAndKey_
 
CertAndKey leafCertAndKey_
 
std::unique_ptr< DefaultCertificateVerifierverifier_
 

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

Detailed Description

Definition at line 21 of file DefaultCertificateVerifierTest.cpp.

Member Function Documentation

static int fizz::test::DefaultCertificateVerifierTest::allowSelfSignedLeafCertCallback ( int  ok,
X509_STORE_CTX *  ctx 
)
inlinestatic

Definition at line 36 of file DefaultCertificateVerifierTest.cpp.

36  {
37  if (X509_STORE_CTX_get_error(ctx) ==
38  X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) {
39  return 1;
40  }
41  return ok;
42  }
void fizz::test::DefaultCertificateVerifierTest::SetUp ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 23 of file DefaultCertificateVerifierTest.cpp.

References ASSERT_EQ, ASSERT_TRUE, fizz::test::createCert(), folly::gen::move, and verifier_.

23  {
24  OpenSSL_add_all_algorithms();
25  folly::ssl::X509StoreUniquePtr store(X509_STORE_new());
26  ASSERT_TRUE(store);
27  rootCertAndKey_ = createCert("root", true, nullptr);
28  leafCertAndKey_ = createCert("leaf", false, &rootCertAndKey_);
29  ASSERT_EQ(X509_STORE_add_cert(store.get(), rootCertAndKey_.cert.get()), 1);
30  verifier_ = std::make_unique<DefaultCertificateVerifier>(
32  }
#define ASSERT_EQ(val1, val2)
Definition: gtest.h:1956
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
std::unique_ptr< DefaultCertificateVerifier > verifier_
std::unique_ptr< X509_STORE, X509StoreDeleter > X509StoreUniquePtr
folly::ssl::X509UniquePtr cert
Definition: Utilities.h:17
CertAndKey createCert(std::string cn, bool ca, CertAndKey *issuer)
Definition: Utilities.h:35
#define ASSERT_TRUE(condition)
Definition: gtest.h:1865
void fizz::test::DefaultCertificateVerifierTest::TearDown ( )
inlineoverridevirtual

Reimplemented from testing::Test.

Definition at line 34 of file DefaultCertificateVerifierTest.cpp.

34 {}

Member Data Documentation

CertAndKey fizz::test::DefaultCertificateVerifierTest::leafCertAndKey_
protected

Definition at line 46 of file DefaultCertificateVerifierTest.cpp.

CertAndKey fizz::test::DefaultCertificateVerifierTest::rootCertAndKey_
protected

Definition at line 45 of file DefaultCertificateVerifierTest.cpp.

std::unique_ptr<DefaultCertificateVerifier> fizz::test::DefaultCertificateVerifierTest::verifier_
protected

Definition at line 47 of file DefaultCertificateVerifierTest.cpp.


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