#include <gtest/gtest.h>
#include <openssl/bio.h>
#include <openssl/bytestring.h>
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/pkcs8.h>
#include <openssl/mem.h>
#include <openssl/span.h>
#include <openssl/stack.h>
#include <openssl/x509.h>
#include "../test/test_data.h"
#include "../test/test_util.h"
static const char kPassword[] = …;
static const char kUnicodePassword[] = …;
static bssl::Span<const uint8_t> StringToBytes(const std::string &str) { … }
static void TestImpl(const char *name, bssl::Span<const uint8_t> der,
const char *password,
const char *friendly_name) { … }
static void TestCompat(bssl::Span<const uint8_t> der) { … }
TEST(PKCS12Test, TestOpenSSL) { … }
TEST(PKCS12Test, TestNSS) { … }
TEST(PKCS12Test, TestWindows) { … }
TEST(PKCS12Test, TestPBES2) { … }
TEST(PKCS12Test, TestNoEncryption) { … }
TEST(PKCS12Test, TestEmptyPassword) { … }
TEST(PKCS12Test, TestNullPassword) { … }
TEST(PKCS12Test, TestUnicode) { … }
TEST(PKCS12Test, TestWindowsCompat) { … }
static const uint8_t kTestKey[] = …;
static const uint8_t kTestCert[] = …;
static const uint8_t kTestCert2[] = …;
static bssl::UniquePtr<X509> LoadX509(bssl::Span<const uint8_t> der) { … }
static bssl::UniquePtr<EVP_PKEY> LoadPrivateKey(bssl::Span<const uint8_t> der) { … }
static void TestRoundTrip(const char *password, const char *name,
bssl::Span<const uint8_t> key_der,
bssl::Span<const uint8_t> cert_der,
std::vector<bssl::Span<const uint8_t>> chain_der,
int key_nid, int cert_nid, int iterations,
int mac_iterations) { … }
TEST(PKCS12Test, RoundTrip) { … }
static bssl::UniquePtr<EVP_PKEY> MakeTestKey() { … }
static bssl::UniquePtr<X509> MakeTestCert(EVP_PKEY *key) { … }
static bool PKCS12CreateVector(std::vector<uint8_t> *out, EVP_PKEY *pkey,
const std::vector<X509 *> &certs) { … }
static void ExpectPKCS12Parse(bssl::Span<const uint8_t> in,
EVP_PKEY *expect_key, X509 *expect_cert,
const std::vector<X509 *> &expect_ca_certs) { … }
TEST(PKCS12Test, Order) { … }
TEST(PKCS12Test, CreateWithAlias) { … }
TEST(PKCS12Test, MissingContent) { … }