13 #include <sodium/randombytes.h> 15 using namespace folly;
24 CHECK_EQ(BIO_write(bio.get(), key.
data(), key.
size()), key.
size());
26 PEM_read_bio_PrivateKey(bio.get(),
nullptr,
nullptr,
nullptr));
34 CHECK_EQ(BIO_write(bio.get(), key.
data(), key.
size()), key.
size());
36 PEM_read_bio_PUBKEY(bio.get(),
nullptr,
nullptr,
nullptr));
51 CHECK_EQ(BIO_write(bio.get(), cert.
data(), cert.
size()), cert.
size());
52 X509UniquePtr x509(PEM_read_bio_X509(bio.get(),
nullptr,
nullptr,
nullptr));
62 []() {
return "test"; },
63 []() {
return (
uint32_t)0x44444444; },
66 [](
void*
const buf,
const size_t size) { memset(buf, 0x44,
size); },
70 randombytes_set_implementation(&mockRandom);
bool unhexlify(const InputString &input, OutputString &output)
std::unique_ptr< X509, X509Deleter > X509UniquePtr
std::unique_ptr< BIO, BioDeleter > BioUniquePtr
std::unique_ptr< folly::IOBuf > toIOBuf(std::string hexData)
constexpr size_type size() const
std::unique_ptr< EVP_PKEY, EvpPkeyDeleter > EvpPkeyUniquePtr
EvpPkeyUniquePtr getPrivateKey(StringPiece key)
—— Concurrent Priority Queue Implementation ——
folly::ssl::X509UniquePtr getCert(folly::StringPiece cert)
static struct randombytes_implementation mockRandom
constexpr auto size(C const &c) -> decltype(c.size())
constexpr Iter data() const
std::unique_ptr< folly::IOBuf > getCertData(folly::StringPiece cert)
EvpPkeyUniquePtr getPublicKey(StringPiece key)
static std::unique_ptr< IOBuf > derEncode(X509 &)
static std::unique_ptr< IOBuf > copyBuffer(const void *buf, std::size_t size, std::size_t headroom=0, std::size_t minTailroom=0)