proxygen
|
#include <folly/ssl/OpenSSLCertUtils.h>
#include <folly/Format.h>
#include <folly/Range.h>
#include <folly/String.h>
#include <folly/container/Enumerate.h>
#include <folly/portability/GTest.h>
#include <folly/portability/OpenSSL.h>
#include <folly/ssl/Init.h>
#include <folly/ssl/OpenSSLPtrTypes.h>
Go to the source code of this file.
Classes | |
class | OpenSSLCertUtilsTest |
Variables | |
const char * | kTestCertWithoutSan = "folly/io/async/test/certs/tests-cert.pem" |
const char * | kTestCa = "folly/io/async/test/certs/ca-cert.pem" |
const std::string | kTestKey |
const std::string | kTestCertWithSan |
const std::string | kTestCertBundle |
INSTANTIATE_TEST_CASE_P | ( | OpenSSLCertUtilsTest | , |
OpenSSLCertUtilsTest | , | ||
Bool() | |||
) |
|
static |
Definition at line 157 of file OpenSSLCertUtilsTest.cpp.
References folly::Range< Iter >::data(), and folly::Range< Iter >::size().
Referenced by TEST_P().
|
static |
Definition at line 144 of file OpenSSLCertUtilsTest.cpp.
Referenced by TEST_P().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestX509CN | |||
) |
Definition at line 189 of file OpenSSLCertUtilsTest.cpp.
References EXPECT_EQ, EXPECT_NE, folly::ssl::OpenSSLCertUtils::getCommonName(), folly::ssl::OpenSSLCertUtils::getSubjectAltNames(), kTestCertWithoutSan, and readCertFromFile().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestX509Sans | |||
) |
Definition at line 198 of file OpenSSLCertUtilsTest.cpp.
References kTestCertWithSan, readCertFromData(), and validateTestCertWithSAN().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestX509IssuerAndSubject | |||
) |
Definition at line 203 of file OpenSSLCertUtilsTest.cpp.
References EXPECT_EQ, EXPECT_NE, folly::ssl::OpenSSLCertUtils::getIssuer(), folly::ssl::OpenSSLCertUtils::getSubject(), kTestCertWithSan, and readCertFromData().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestX509Dates | |||
) |
Definition at line 214 of file OpenSSLCertUtilsTest.cpp.
References EXPECT_EQ, EXPECT_NE, folly::ssl::OpenSSLCertUtils::getNotAfterTime(), folly::ssl::OpenSSLCertUtils::getNotBeforeTime(), kTestCertWithSan, and readCertFromData().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestX509Summary | |||
) |
Definition at line 223 of file OpenSSLCertUtilsTest.cpp.
References EXPECT_EQ, EXPECT_NE, kTestCertWithSan, readCertFromData(), and folly::ssl::OpenSSLCertUtils::toString().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestDerEncodeDecode | |||
) |
Definition at line 249 of file OpenSSLCertUtilsTest.cpp.
References folly::ssl::OpenSSLCertUtils::derDecode(), folly::ssl::OpenSSLCertUtils::derEncode(), EXPECT_EQ, kTestCertWithSan, readCertFromData(), and folly::ssl::OpenSSLCertUtils::toString().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestDerDecodeJunkData | |||
) |
Definition at line 260 of file OpenSSLCertUtilsTest.cpp.
References folly::ssl::OpenSSLCertUtils::derDecode(), and EXPECT_THROW.
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestDerDecodeTooShort | |||
) |
Definition at line 266 of file OpenSSLCertUtilsTest.cpp.
References folly::ssl::OpenSSLCertUtils::derDecode(), folly::ssl::OpenSSLCertUtils::derEncode(), EXPECT_THROW, kTestCertWithSan, and readCertFromData().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestReadCertsFromBuffer | |||
) |
Definition at line 276 of file OpenSSLCertUtilsTest.cpp.
References kTestCertBundle, folly::ssl::OpenSSLCertUtils::readCertsFromBuffer(), and validateTestCertBundle().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestReadCertsFromMixedBuffer | |||
) |
Definition at line 284 of file OpenSSLCertUtilsTest.cpp.
References ASSERT_EQ, kTestCertWithSan, kTestKey, folly::ssl::OpenSSLCertUtils::readCertsFromBuffer(), and validateTestCertWithSAN().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestX509Digest | |||
) |
Definition at line 296 of file OpenSSLCertUtilsTest.cpp.
References EXPECT_EQ, EXPECT_NE, folly::ssl::OpenSSLCertUtils::getDigestSha1(), folly::ssl::OpenSSLCertUtils::getDigestSha256(), folly::hexlify(), kTestCertWithoutSan, folly::range(), and readCertFromFile().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestX509Store | |||
) |
Definition at line 311 of file OpenSSLCertUtilsTest.cpp.
References EXPECT_EQ, EXPECT_NE, kTestCa, kTestCertWithoutSan, readCertFromFile(), and folly::ssl::OpenSSLCertUtils::readStoreFromFile().
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestProcessMalformedCertBuf | |||
) |
Definition at line 323 of file OpenSSLCertUtilsTest.cpp.
References EXPECT_THROW, kTestCertBundle, folly::ssl::OpenSSLCertUtils::readCertsFromBuffer(), folly::ssl::OpenSSLCertUtils::readStoreFromBuffer(), and string.
TEST_P | ( | OpenSSLCertUtilsTest | , |
TestReadStoreDuplicate | |||
) |
Definition at line 353 of file OpenSSLCertUtilsTest.cpp.
References EXPECT_EQ, EXPECT_NE, kTestCertBundle, and folly::ssl::OpenSSLCertUtils::readStoreFromBuffer().
|
static |
Definition at line 168 of file OpenSSLCertUtilsTest.cpp.
References folly::enumerate(), EXPECT_EQ, EXPECT_TRUE, folly::ssl::OpenSSLCertUtils::getCommonName(), i, and folly::sformat().
Referenced by TEST_P().
|
static |
Definition at line 179 of file OpenSSLCertUtilsTest.cpp.
References ASSERT_NE, EXPECT_EQ, folly::ssl::OpenSSLCertUtils::getCommonName(), and folly::ssl::OpenSSLCertUtils::getSubjectAltNames().
Referenced by TEST_P().
const char* kTestCa = "folly/io/async/test/certs/ca-cert.pem" |
Definition at line 31 of file OpenSSLCertUtilsTest.cpp.
Referenced by TEST_P().
const std::string kTestCertBundle |
Definition at line 64 of file OpenSSLCertUtilsTest.cpp.
Referenced by TEST_P().
const char* kTestCertWithoutSan = "folly/io/async/test/certs/tests-cert.pem" |
Definition at line 30 of file OpenSSLCertUtilsTest.cpp.
Referenced by TEST_P().
const std::string kTestCertWithSan |
Definition at line 41 of file OpenSSLCertUtilsTest.cpp.
Referenced by TEST_P().
const std::string kTestKey |
Definition at line 34 of file OpenSSLCertUtilsTest.cpp.
Referenced by folly::getctx(), folly::TEST(), and TEST_P().