Go to the documentation of this file.
68 "MIIBuTCCAUCgAwIBAgIUTLtjSBzx53qZRvZ6Ur7D9kgoOHkwCgYIKoZIzj0EAwIw\n"
69 "EzERMA8GA1UEAwwIdW5pdHRlc3QwIBcNMjMxMTIxMDk1NDQ3WhgPMjA3ODA4MjQw\n"
70 "OTU0NDdaMBMxETAPBgNVBAMMCHVuaXR0ZXN0MHYwEAYHKoZIzj0CAQYFK4EEACID\n"
71 "YgAEHYB2hn2xx3f4lClXDtdi36P19pMZA+kI1Dkv/Vn10vBZ/j9oa+P99T8duz/e\n"
72 "QlPeHpesNJO4fX8iEDj6+vMeWejOT7jAQ4MmG5EZjpcBKxCfwFooEvzu8bVujUcu\n"
73 "wTQEo1MwUTAdBgNVHQ4EFgQUPcgBEVXjF5vYfDsInoE3dF6UfQswHwYDVR0jBBgw\n"
74 "FoAUPcgBEVXjF5vYfDsInoE3dF6UfQswDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjO\n"
75 "PQQDAgNnADBkAjBLPAGrQAyinigqiu0RomoV8TVaknVLFSq6H6A8jgvzfsFCUK1O\n"
76 "dvNZhFPM6idKB+oCME2JLOBANCSV8o7aJzq7SYHKwPyb1J4JFlwKe/0Jpv7oh9b1\n"
77 "IJbuaM9Z/VSKbrIXGg==\n"
78 "-----END CERTIFICATE-----\n";
106 #ifdef ENABLE_CRYPTO_OPENSSL
107 cert = SSL_CTX_get0_certificate(
ctx.ctx);
108 #elif defined(ENABLE_CRYPTO_MBEDTLS)
109 cert =
ctx.crt_chain;
128 const struct CMUnitTest tests[] = {
132 #if defined(ENABLE_CRYPTO_OPENSSL)
136 int ret = cmocka_run_group_tests_name(
"crypto tests", tests, NULL, NULL);
138 #if defined(ENABLE_CRYPTO_OPENSSL)
struct buffer buffer_read_from_file(const char *filename, struct gc_arena *gc)
buffer_read_from_file - copy the content of a file into a buffer
void tls_ctx_load_cert_file(struct tls_root_ctx *ctx, const char *cert_file, bool cert_file_inline)
Use Windows cryptoapi for key and cert, and add to library-specific TLS context.
static struct gc_arena gc_new(void)
void tls_init_lib(void)
Perform any static initialisation necessary by the library.
static void openvpn_unit_test_setup()
Sets up the environment for unit tests like making both stderr and stdout non-buffered to avoid messa...
void tls_ctx_client_new(struct tls_root_ctx *ctx)
Initialises a library-specific TLS context for a client.
void throw_signal(const int signum)
Throw a hard signal.
void tls_free_lib(void)
Free any global SSL library-specific data structures.
result_t backend_x509_write_pem(openvpn_x509_cert_t *cert, const char *filename)
static void crypto_pem_encode_certificate(void **state)
const char * unittest_cert
struct signal_info siginfo_static
void tls_ctx_free(struct tls_root_ctx *ctx)
Frees the library-specific TLSv1 context.
Wrapper structure for dynamically allocated memory.
const char * strerror_win32(DWORD errnum, struct gc_arena *gc)
Garbage collection arena used to keep track of dynamically allocated memory.
static const char * get_tmp_dir()
Structure that wraps the TLS context.
static void gc_free(struct gc_arena *a)
const char * win_get_tempdir(void)