73#if defined(ENABLE_CRYPTO_OPENSSL) && (OPENSSL_VERSION_NUMBER > 0x30000000L)
74#define HAVE_OPENSSL_STORE
97 "-----BEGIN CERTIFICATE-----\n"
98 "MIICBjCCAYygAwIBAgIUFoXgpP4beykV7tpgrjHQTWPGi4cwCgYIKoZIzj0EAwIw\n"
99 "HjEcMBoGA1UEAwwTb3Zwbi10ZXN0LXNlY3AzODRyMTAeFw0yNTA5MDgxMzExNTBa\n"
100 "Fw0zNTA5MDYxMzExNTBaMB4xHDAaBgNVBAMME292cG4tdGVzdC1zZWNwMzg0cjEw\n"
101 "djAQBgcqhkjOPQIBBgUrgQQAIgNiAAQVDmf+TZB3rW6zqWFox606u/PhA93ysX/h\n"
102 "1s2xyq9+QGzIdE/hks6p/Yzyu7RLOUjxvO0J45RHcYmo67DlvSOi496T3zrgvp1H\n"
103 "KfHD5ohMyvzw0+e8lmjJqJjn+PegMkOjgYowgYcwHQYDVR0OBBYEFCH1eYnaV8fh\n"
104 "E3Bv7lyrlYu24eoVMB8GA1UdIwQYMBaAFCH1eYnaV8fhE3Bv7lyrlYu24eoVMA8G\n"
105 "A1UdEwEB/wQFMAMBAf8wHwYDVR0RBBgwFoIUdW5pdHRlc3QuZXhhbXBsZS5jb20w\n"
106 "EwYDVR0lBAwwCgYIKwYBBQUHAwIwCgYIKoZIzj0EAwIDaAAwZQIxAL7q7jcwTOuq\n"
107 "5sp0Beq81Vnznd3gsDZYNs1OYRWH33xergDVKlBb6kCwus0dhghtVAIwIgT4ytkY\n"
108 "oAPx8LB3oP8ubEu1ue6V9jZln/cCiLyXDDtaiJOZHtDqHGfHqvc6rAok\n"
109 "-----END CERTIFICATE-----\n";
112 "-----BEGIN PRIVATE KEY-----\n"
113 "MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDAXBC7tpa9UepoMVZlM\n"
114 "OxUubkECGK7aWFebxDc3UPoEQemEPMOCdkWBSU/t7Mm4R66hZANiAAQVDmf+TZB3\n"
115 "rW6zqWFox606u/PhA93ysX/h1s2xyq9+QGzIdE/hks6p/Yzyu7RLOUjxvO0J45RH\n"
116 "cYmo67DlvSOi496T3zrgvp1HKfHD5ohMyvzw0+e8lmjJqJjn+PegMkM=\n"
117 "-----END PRIVATE KEY-----\n";
137 if (certfd < 0 || keyfd < 0)
139 fail_msg(
"make tmpfile for certificate or key data failed (error = %d)", errno);
174#ifdef ENABLE_CRYPTO_OPENSSL
175 cert = SSL_CTX_get0_certificate(
ctx.ctx);
176#elif defined(ENABLE_CRYPTO_MBEDTLS)
177 cert =
ctx.crt_chain;
218#if !defined(HAVE_OPENSSL_STORE)
232 const char *lead =
"/";
234 const char *lead =
"";
331 assert_int_equal(buf.
len, src.
len);
332 assert_memory_equal(
BPTR(&src),
BPTR(&buf), i);
373 assert_int_equal(buf.
len, src.
len);
392 int expected_epoch = epoch ? 4 : 0;
403 if (epoch && !chachapoly)
455 struct epoch_key e1 = { .epoch = 1, .epoch_key = { 0 } };
488 bool ischacha = !strcmp(cipher,
"ChaCha20-Poly1305");
499 bool ischacha = !strcmp(cipher,
"ChaCha20-Poly1305");
602 const uint8_t
key[] = {
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'0',
'1',
'2',
603 '3',
'4',
'5',
'6',
'7',
'A',
'B',
'C',
'D',
'E',
'F',
604 'G',
'H',
'j',
'k',
'u',
'c',
'h',
'e',
'n',
'l' };
606 static_assert(
sizeof(
key) == 32,
"Size of key should be 32 bytes");
612 for (
size_t i = 0; i <
sizeof(
key2.
keys); i++)
614 keydata[i] = (uint8_t)(
key[i %
sizeof(
key)] ^ i);
653 const char *plaintext =
"The quick little fox jumps over the bureaucratic hurdles";
676 const uint8_t *ad_start =
BPTR(&buf);
681 uint8_t packetid1[8] = { 0, 0x04, 0, 0, 0, 0, 0, 1 };
682 assert_memory_equal(
BPTR(&buf), packetid1, 8);
686 uint8_t packetid1[4] = { 0, 0, 0, 1 };
687 assert_memory_equal(
BPTR(&buf), packetid1, 4);
693 const uint8_t exp_tag_epoch[16] = { 0x0f, 0xff, 0xf5, 0x91, 0x3d, 0x39, 0xd7, 0x5b,
694 0x18, 0x57, 0x3b, 0x57, 0x48, 0x58, 0x9a, 0x7d };
700 uint8_t *tag_location =
BPTR(&buf) + 4;
701 const uint8_t exp_tag_noepoch[16] = { 0x1f, 0xdd, 0x90, 0x8f, 0x0e, 0x9d, 0xc2, 0x5e,
702 0x79, 0xd8, 0x32, 0x02, 0x0d, 0x58, 0xe7, 0x3f };
709 const uint8_t bytesat14[6] = { 0x36, 0xaa, 0xb4, 0xd4, 0x9c, 0xe6 };
710 assert_memory_equal(
BPTR(&buf) + 14, bytesat14,
sizeof(bytesat14));
714 const uint8_t bytesat30[6] = { 0xa8, 0x2e, 0x6b, 0x17, 0x06, 0xd9 };
715 assert_memory_equal(
BPTR(&buf) + 30, bytesat30,
sizeof(bytesat30));
722 assert_int_equal(buf.
len, strlen(plaintext));
723 assert_memory_equal(
BPTR(&buf), plaintext, strlen(plaintext));
741#if defined(ENABLE_CRYPTO_MBEDTLS)
745 mbedtls_x509_crt *cert;
747 int ret = mbedtls_x509_crt_parse(cert, (
const unsigned char *)cert_str,
748 strlen(cert_str) + 1);
750 assert_int_equal(ret, 0);
757 mbedtls_x509_crt_free(cert);
764 BIO *in = BIO_new_mem_buf((
char *)cert_str, -1);
766 X509 *cert = PEM_read_bio_X509(in, NULL, NULL, NULL);
767 assert_non_null(cert);
784 "-----BEGIN CERTIFICATE-----\n"
785 "MIICkzCCAhqgAwIBAgIUKDsZM+PApGdaD2QF9iYaxoFJAkowCgYIKoZIzj0EAwIw\n"
786 "ZTEcMBoGA1UEAwwTb3Zwbi10ZXN0LXNlY3AzODRyMTEoMCYGA1UECgwfT3BlblZQ\n"
787 "TiBVbml0IFRlc3QgRXhhbXBsZSBDb3JwLjEbMBkGA1UECwwSQ2VydCBEZXRhaWxz\n"
788 "IERlcHQuMB4XDTI2MDcwNzEwNTIxNloXDTM2MDcwNDEwNTIxNlowZTEcMBoGA1UE\n"
789 "AwwTb3Zwbi10ZXN0LXNlY3AzODRyMTEoMCYGA1UECgwfT3BlblZQTiBVbml0IFRl\n"
790 "c3QgRXhhbXBsZSBDb3JwLjEbMBkGA1UECwwSQ2VydCBEZXRhaWxzIERlcHQuMHYw\n"
791 "EAYHKoZIzj0CAQYFK4EEACIDYgAEOlKoQVk+wbBD6V/6kg+/oHfqF0Dq08LlCL+B\n"
792 "om4RhutG99QDrow251Ps+Ds/7LQYYRA8+hHyEFrmGM+j2o6KhS5K2uA6dIZL4zLK\n"
793 "vl0NeF2M61Z8tt/IjrFZd+CrEANco4GKMIGHMB0GA1UdDgQWBBSEyG6m+QdWazeg\n"
794 "0CHN7q0edJlqMjAfBgNVHSMEGDAWgBSEyG6m+QdWazeg0CHN7q0edJlqMjAPBgNV\n"
795 "HRMBAf8EBTADAQH/MB8GA1UdEQQYMBaCFHVuaXR0ZXN0LmV4YW1wbGUuY29tMBMG\n"
796 "A1UdJQQMMAoGCCsGAQUFBwMCMAoGCCqGSM49BAMCA2cAMGQCMCyK7aQcyKGW8BWQ\n"
797 "UOYqbJUJZJcviP6ACgJRzK6pgkqt9gY0E0Tb00Qh6D5dBV5i3wIwCMhSgpVJxDrc\n"
798 "pRfligoK8bmv4HEgnV6BDeoDYd41WVMpE9u1issQDHY0SnWC7d9q\n"
799 "-----END CERTIFICATE-----\n";
816#if defined(ENABLE_CRYPTO_MBEDTLS)
817 assert_string_equal(fp,
"28:3B:19:33:E3:C0:A4:67:5A:0F:64:05:F6:26:1A:C6:81:49:02:4A");
819 assert_string_equal(fp,
"28:3b:19:33:e3:c0:a4:67:5a:0f:64:05:f6:26:1a:c6:81:49:02:4a");
830 assert_int_equal(ret,
SUCCESS);
833 assert_int_equal(ret,
SUCCESS);
839 assert_int_equal(ret,
SUCCESS);
844 assert_int_equal(ret,
SUCCESS);
848 assert_int_equal(ret,
FAILURE);
852 assert_int_equal(ret,
FAILURE);
859 assert_int_equal(ret,
FAILURE);
861 assert_int_equal(ret,
FAILURE);
865 assert_int_equal(ret,
FAILURE);
867 assert_int_equal(ret,
FAILURE);
880 "-----BEGIN CERTIFICATE-----\n"
881 "MIIByTCCAVCgAwIBAgIUZuvd8Wfnq5jeRc3ohoJ/Vza54wQwCgYIKoZIzj0EAwIw\n"
882 "HDEMMAoGA1UEAwwDZm9vMQwwCgYDVQQDDANiYXIwHhcNMjYwODI4MTU1NjAwWhcN\n"
883 "MjYwOTI3MTU1NjAwWjAcMQwwCgYDVQQDDANmb28xDDAKBgNVBAMMA2JhcjB2MBAG\n"
884 "ByqGSM49AgEGBSuBBAAiA2IABERAfb210NOACy+QVYAu3EXrcGhTJpZDfhpDnE/h\n"
885 "PvPMWGWzqecTYdseArxZc0T/5Xma36IKCjGGsgN9ypZ5oQugQlB/NrVRCJIuHSGA\n"
886 "hGBWFvnUsqdNo765lGwVdBwhY6NTMFEwHQYDVR0OBBYEFPwnD+wK9R81Syk0qyTI\n"
887 "dFT/BNoJMB8GA1UdIwQYMBaAFPwnD+wK9R81Syk0qyTIdFT/BNoJMA8GA1UdEwEB\n"
888 "/wQFMAMBAf8wCgYIKoZIzj0EAwIDZwAwZAIwGxazGb6RRQtXzOWCPLRKId4e+E88\n"
889 "cwoCK3UwzEr8+Ddf54w5cEZC54f5J6AKFUJjAjBpT/JqF41uK57H+8i/16oZkBcm\n"
890 "OyQnlH8W/UzZo3/weTEBTcNW0iuCpIrS6im8pSk=\n"
891 "-----END CERTIFICATE-----\n";
905 assert_string_equal(username,
"bar");
935 "-----BEGIN CERTIFICATE-----\n"
936 "MIIBZTCB66ADAgECAhRLWdNRl+C20KKBG4QC9HFPWlOtBzAKBggqhkjOPQQDAjAU\n"
937 "MRIwEAYDVQQDDAl3aXRoAG51bGwwHhcNMjYwODI4MTQzMDA4WhcNMzYwODI1MTQz\n"
938 "MDA4WjAUMRIwEAYDVQQDDAl3aXRoAG51bGwwdjAQBgcqhkjOPQIBBgUrgQQAIgNi\n"
939 "AAT7PE+vJCBiB4CVHBcvJVF9n5n/dGQIn4C8HeYE8M2iXYCIRW5wg6/mlPaeiJY/\n"
940 "Ywh3pa8zhto1+aczbJKTvLgRwXn6N5vNpME1c5iWMzY0WHe1dJyVtoRBvkNvy5+k\n"
941 "GuEwCgYIKoZIzj0EAwIDaQAwZgIxAP2ekdQ8muG8Nv2o3PsBp0CqiaSNByGiP75i\n"
942 "k099bUFvHp/3LSp8Wf4JK2iWzc5h6gIxAINBGg2xjlmMgpXxROKA9qQqaM3d92Mp\n"
943 "EzZyRyPM3PGR83ZPbIaYDq8lCVxVlbYr/Q==\n"
944 "-----END CERTIFICATE-----\n";
994 "-----BEGIN CERTIFICATE-----\n"
995 "MIIBnTCCASOgAwIBAgIUR1IGc6A800U14v/ykZNR21aVubowCgYIKoZIzj0EAwIw\n"
996 "MDEcMBoGA1UEAwwTbmFtZSwgTz1JbmplY3RlZE9yZzEQMA4GA1UECgwHUmVhbE9y\n"
997 "ZzAeFw0yNjA4MjgxNTQ3NDdaFw0zNjA4MjUxNTQ3NDdaMDAxHDAaBgNVBAMME25h\n"
998 "bWUsIE89SW5qZWN0ZWRPcmcxEDAOBgNVBAoMB1JlYWxPcmcwdjAQBgcqhkjOPQIB\n"
999 "BgUrgQQAIgNiAAR6zl9QPAbAnHWN//MRdowuhu0Sol6N+lqB/qk+D+2NHCd/t4H9\n"
1000 "cJlswUh6EPsmLxgfMYgO2QwClFWEFWvtXQs8BggoidY6i9pmAPhs8+9fmIyuNVpG\n"
1001 "3vUWZrUBRgylwaIwCgYIKoZIzj0EAwIDaAAwZQIwKzXmR8YPQZ1pratM9meVmGkH\n"
1002 "1rpHgV3U8oeg+jXmfVcZJTpDeDz4yBl4V3KBKT7HAjEAj2qkaTz7fiSwBKsxJQWH\n"
1003 "dQFPBCAYU9zZJvlNnEPtmHIwaD/qHXDeClr/HRItU3B9\n"
1004 "-----END CERTIFICATE-----\n";
1013 assert_non_null(subject);
1016 const char *expected_subject_openssl =
"CN=name\\, O=InjectedOrg, O=RealOrg";
1017 const char *expected_subject_mbedtls =
"CN=name\\, O\\=InjectedOrg, O=RealOrg";
1019 assert_true(strcmp(subject, expected_subject_openssl) == 0 || strcmp(subject, expected_subject_mbedtls) == 0);
1027 const char *peer_info_normal =
1028 "IV_VER=2.6_git\nIV_PLAT=mac\nIV_TCPNL=1\nIV_NCP=2\n"
1029 "IV_CIPHERS=AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305\n"
1030 "IV_PROTO=94\nIV_LZO_STUB=1\nIV_COMP_STUB=1\nP=78\nIV_COMP_STUBv2=1\n"
1031 "IV_SSL=OpenSSL_3.0.5_5_Jul_2022\nIV_LZ4v2=1";
1033 const char *empty =
"";
1034 const char *invalid_proto =
"IV_PROTO=seven\nIV_SSL=7\nP=300\nID=xyz";
1035 const char *test_prefix =
"UV_IV_PROTO=773\nNP=112\nPD=8\n";
1057 assert_string_equal(peer_ciphers,
"AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305");
1064 assert_string_equal(proto,
"94");
1067 const char *double_eq_info =
"FOO=7\nFOO==new";
1072 assert_string_equal(foo,
"=7");
1073 assert_string_equal(foo_eq,
"7");
1074 assert_string_equal(foo_2eq,
"new");
1092 const struct CMUnitTest tests[] = {
1118#if defined(ENABLE_CRYPTO_OPENSSL)
1122 int ret = cmocka_run_group_tests_name(
"ssl tests", tests,
init,
cleanup);
1124#if defined(ENABLE_CRYPTO_OPENSSL)
bool buf_printf(struct buffer *buf, const char *format,...)
printf-style append to a buffer with overflow check.
struct buffer alloc_buf_gc(size_t size, struct gc_arena *gc)
Allocate a buffer of the given size under garbage collection.
bool string_mod(char *str, const unsigned int inclusive, const unsigned int exclusive, const char replace)
Modifies a string in place by replacing certain classes of characters of it with a specified characte...
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
Buffer management functions and garbage collection.
#define BEND(buf)
Return a pointer one past the end of the buffer content.
#define BSTR(buf)
Return the buffer content pointer cast to char *.
#define CC_ANY
any character
#define BPTR(buf)
Return a pointer to the start of the buffer content.
static uint8_t * buf_write_alloc(struct buffer *buf, size_t size)
Reserve space at the end of a buffer for writing.
static bool buf_advance(struct buffer *buf, ssize_t size)
Advance the content start of a buffer, consuming bytes from the front.
static bool buf_write(struct buffer *dest, const void *src, size_t size)
Append data to a buffer.
#define CC_BACKSLASH
backslash
static bool buf_write_u8(struct buffer *dest, uint8_t data)
Append a uint8_t to a buffer.
#define BLEN(buf)
Return the length of the buffer content in bytes.
#define BLENZ(buf)
Return the length of the buffer content as a size_t.
static void gc_free(struct gc_arena *a)
Free all allocations in a garbage collection arena.
#define ALLOC_OBJ_CLEAR(dptr, type)
Allocate and zero-initialise memory for a single object of the given type.
#define buf_init(buf, offset)
static struct gc_arena gc_new(void)
Allocate and return a new, empty garbage collection arena.
void free_key_ctx_bi(struct key_ctx_bi *ctx)
void prng_bytes(uint8_t *output, int len)
void init_key_ctx_bi(struct key_ctx_bi *ctx, const struct key2 *key2, int key_direction, const struct key_type *kt, const char *name)
Data Channel Cryptography Module.
#define CO_EPOCH_DATA_KEY_FORMAT
Bit-flag indicating the epoch the data format.
#define KEY_DIRECTION_BIDIRECTIONAL
static bool aead_usage_limit_reached(const uint64_t limit, const struct key_ctx *key_ctx, int64_t higest_pid)
Checks if the usage limit for an AEAD cipher is reached.
static struct key_type create_kt(const char *cipher, const char *md, const char *optname)
Creates and validates an instance of struct key_type with the provided algs.
static bool cipher_valid(const char *ciphername)
Returns if the cipher is valid, based on the given cipher name.
#define OPENVPN_AEAD_TAG_LENGTH
void free_epoch_key_ctx(struct crypto_options *co)
Frees the extra data structures used by epoch keys in crypto_options.
void epoch_init_key_ctx(struct crypto_options *co, const struct key_type *key_type, const struct epoch_key *e1_send, const struct epoch_key *e1_recv, uint16_t future_key_count)
Initialises data channel keys and internal structures for epoch data keys using the provided E0 epoch...
void epoch_iterate_send_key(struct crypto_options *co)
Updates the send key and send_epoch_key in cryptio_options->key_ctx_bi to use the next epoch.
void openvpn_encrypt(struct buffer *buf, struct buffer work, struct crypto_options *opt)
Encrypt and HMAC sign a packet so that it can be sent as a data channel VPN tunnel packet to a remote...
bool openvpn_decrypt(struct buffer *buf, struct buffer work, struct crypto_options *opt, const struct frame *frame, const uint8_t *ad_start)
HMAC verify and decrypt a data channel packet received from a remote OpenVPN peer.
#define RELIABLE_ACK_SIZE
The maximum number of packet IDs waiting to be acknowledged which can be stored in one reliable_ack s...
static void update_time(void)
void packet_id_init(struct packet_id *p, int seq_backtrack, int time_backtrack, const char *name, int unit)
void packet_id_free(struct packet_id *p)
#define PACKET_ID_EPOCH_MAX
struct signal_info siginfo_static
static char * auth_challenge
Control Channel SSL/Data channel negotiation module.
Control Channel SSL library backend module.
void tls_ctx_free(struct tls_root_ctx *ctx)
Frees the library-specific TLSv1 context.
int tls_ctx_load_priv_file(struct tls_root_ctx *ctx, const char *priv_key_file, bool priv_key_file_inline)
Load private key file into the given TLS context.
void tls_free_lib(void)
Free any global SSL library-specific data structures.
void tls_init_lib(void)
Perform any static initialisation necessary by the library.
void tls_ctx_new(struct tls_root_ctx *ctx)
Initialise a library-specific TLS context.
void tls_ctx_load_cert_file(struct tls_root_ctx *ctx, const char *cert_file, bool cert_file_inline)
Load certificate file into the given TLS context.
char * extract_var_peer_info(const char *peer_info, const char *var, struct gc_arena *gc)
Extracts a variable from peer info, the returned string will be allocated using the supplied gc_arena...
unsigned int peer_info_extract_int(const char *peer_info, const char *field, const char *format, unsigned int default_value)
Extracts the named integer variable and returns its value or default_value if it cannot be extracted.
uint32_t extract_asymmetric_peer_id(const char *peer_info)
Extracts the ID variable and returns its value or MAX_PEER_ID if it cannot be extracted.
unsigned int peer_info_extract_uint(const char *peer_info, const char *field)
Extracts the named integer variable and returns its value or 0 if it cannot be extracted.
static unsigned int extract_iv_proto(const char *peer_info)
Extracts the IV_PROTO variable and returns its value or 0 if it cannot be extracted.
Control Channel Verification Module.
#define TLS_USERNAME_LEN
Maximum length of common name.
Control Channel Verification Module library-specific backend interface.
result_t backend_x509_write_pem(openvpn_x509_cert_t *cert, const char *filename)
char * backend_x509_get_serial_hex(openvpn_x509_cert_t *cert, struct gc_arena *gc)
char * x509_get_subject(openvpn_x509_cert_t *cert, struct gc_arena *gc)
char * backend_x509_get_serial(openvpn_x509_cert_t *cert, struct gc_arena *gc)
result_t backend_x509_get_username(char *common_name, size_t cn_len, char *x509_username_field, openvpn_x509_cert_t *peer_cert)
mbedtls_x509_crt openvpn_x509_cert_t
Wrapper structure for dynamically allocated memory.
int capacity
Size in bytes of memory allocated by malloc().
int len
Length in bytes of the actual content within the allocated memory.
Security parameter state for processing data channel packets.
unsigned int flags
Bit-flags determining behavior of security operation functions.
struct key_ctx_bi key_ctx_bi
OpenSSL cipher and HMAC contexts for both sending and receiving directions.
struct packet_id packet_id
Current packet ID state for both sending and receiving directions.
uint8_t epoch_key[SHA256_DIGEST_LENGTH]
Packet geometry parameters.
int tun_mtu
the (user) configured tun-mtu.
struct frame::@074234134026241341315172337061247271261307273127 buf
int payload_size
the maximum size that a payload that our buffers can hold from either tun device or network link.
int headroom
the headroom in the buffer, this is choosen to allow all potential header to be added before the pack...
int tailroom
the tailroom in the buffer.
Garbage collection arena used to keep track of dynamically allocated memory.
Container for bidirectional cipher and HMAC key material.
struct key keys[2]
Two unidirectional sets of key material.
struct key_ctx encrypt
Cipher and/or HMAC contexts for sending direction.
uint16_t epoch
OpenVPN data channel epoch, this variable holds the epoch number this key belongs to.
uint64_t plaintext_blocks
Counter for the number of plaintext block encrypted using this cipher with the current key in number ...
const char * cipher
const name of the cipher
Container for unidirectional cipher and HMAC key material.
uint8_t cipher[MAX_CIPHER_KEY_LENGTH]
Key material for cipher operations.
uint8_t hmac[MAX_HMAC_KEY_LENGTH]
Key material for HMAC operations.
struct packet_id_send send
Structure that wraps the TLS context.
static void openvpn_unit_test_setup(void)
Sets up the environment for unit tests like making both stderr and stdout non-buffered to avoid messa...
static int cleanup(void **state)
static int init(void **state)
static const char * cert_details_test_cert
void crypto_test_print_cert_details(void **state)
static void test_data_channel_roundtrip_aes_192_cbc(void **state)
static void test_load_certificate_and_key_uri(void **state)
bool get_user_pass_cr(struct user_pass *up, const char *auth_file, const char *prefix, const unsigned int flags, const char *auth_challenge)
Retrieves the user credentials from various sources depending on the flags.
static openvpn_x509_cert_t * get_certificate(const char *cert_str)
static void test_data_channel_roundtrip_aes_192_gcm_epoch(void **state)
const char *const cert_details_org
static void encrypt_one_packet(struct crypto_options *co, int len)
void ssl_test_extract_peer_info(void **state)
static void test_data_channel_roundtrip_aes_256_cbc(void **state)
static void test_load_certificate_and_key(void **state)
void ssl_test_extract_last_matching_field(void **state)
static const char * cert_with_two_cns
static void test_data_channel_known_vectors_run(bool epoch)
static struct key2 create_key(void)
void purge_user_pass(struct user_pass *up, bool force)
static void check_aead_limits(struct crypto_options *co, bool chachapoly)
const char * strerror_win32(DWORD errnum, struct gc_arena *gc)
static const char *const unittest_cert
static struct @041167262151223363234312074372224332231333353344 global_state
static void run_data_channel_with_cipher_epoch(const char *cipher)
const char *const cert_details_serial_number
static const char * cert_with_null
static int cleanup(void **state)
static void do_data_channel_round_trip(struct crypto_options *co)
static void test_data_channel_roundtrip_aes_128_gcm_epoch(void **state)
static void crypto_pem_encode_certificate(void **state)
static void test_data_channel_roundtrip_aes_128_gcm(void **state)
static const char * cert_with_rfc_2253_chars
void ssl_test_escape_rfc_2253_chars_in_subject(void **state)
static void test_data_channel_roundtrip_aes_192_gcm(void **state)
void throw_signal(const int signum)
Throw a hard signal.
static void init_frame_parameters(struct frame *frame)
static void test_data_channel_roundtrip_bf_cbc(void **state)
static void test_data_channel_roundtrip_chacha20_poly1305(void **state)
void ssl_test_reject_null_in_cert_subject(void **state)
static void uninit_crypto_options(struct crypto_options *co)
static void test_data_channel_roundtrip_aes_256_gcm(void **state)
const char *const cert_details_cname
static void test_data_channel_known_vectors_epoch(void **state)
const char *const cert_details_serial_number_hex
static void test_data_channel_roundtrip_chacha20_poly1305_epoch(void **state)
static const char *const unittest_key
static void test_data_channel_roundtrip_aes_256_gcm_epoch(void **state)
static int init(void **state)
static void free_certificate(openvpn_x509_cert_t *cert)
static void test_data_channel_roundtrip_aes_128_cbc(void **state)
static struct crypto_options init_crypto_options(const char *cipher, const char *auth, bool epoch, struct key2 *statickey)
const char *const cert_details_org_unit
static void run_data_channel_with_cipher(const char *cipher, const char *auth)
static void test_data_channel_known_vectors_shortpktid(void **state)