OpenVPN
|
#include "syshead.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <setjmp.h>
#include <cmocka.h>
#include "crypto.h"
#include "options.h"
#include "ssl_backend.h"
#include "mss.h"
#include "test_common.h"
Go to the source code of this file.
Functions | |
static void | crypto_pem_encode_decode_loopback (void **state) |
static void | test_translate_cipher (const char *ciphername, const char *openvpn_name) |
static void | test_cipher_names (const char *ciphername, const char *openvpn_name) |
static void | crypto_translate_cipher_names (void **state) |
static void | crypto_test_tls_prf (void **state) |
static void | crypto_test_hmac (void **state) |
static void | test_occ_mtu_calculation (void **state) |
static void | test_mssfix_mtu_calculation (void **state) |
int | main (void) |
Variables | |
static const char | testtext [] = "Dummy text to test PEM encoding" |
static const char * | ipsumlorem |
static uint8_t | testkey [20] = {0x0b, 0x00} |
static uint8_t | goodhash [20] |
|
static |
Definition at line 47 of file test_crypto.c.
References BLEN, BPTR, buf_set_read(), buf_set_write(), crypto_pem_decode(), crypto_pem_encode(), gc_free(), gc_new(), and testtext.
Referenced by main().
|
static |
Definition at line 179 of file test_crypto.c.
References goodhash, hmac_ctx_cleanup(), hmac_ctx_final(), hmac_ctx_free(), hmac_ctx_init(), hmac_ctx_new(), hmac_ctx_reset(), hmac_ctx_update(), ipsumlorem, md_kt_size(), and testkey.
Referenced by main().
|
static |
Definition at line 145 of file test_crypto.c.
References ipsumlorem, and ssl_tls1_PRF().
Referenced by main().
|
static |
int main | ( | void | ) |
Definition at line 452 of file test_crypto.c.
References crypto_pem_encode_decode_loopback(), crypto_test_hmac(), crypto_test_tls_prf(), crypto_translate_cipher_names(), openvpn_unit_test_setup(), test_mssfix_mtu_calculation(), and test_occ_mtu_calculation().
|
static |
Definition at line 89 of file test_crypto.c.
References gc_free(), gc_new(), string_alloc(), and test_translate_cipher().
Referenced by crypto_translate_cipher_names().
|
static |
Definition at line 343 of file test_crypto.c.
References compress_options::alg, options::authname, options::ce, options::ciphername, options::comp, COMP_ALG_LZO, COMP_ALG_UNDEF, http-client::f, frame_calculate_dynamic(), gc_free(), gc_new(), init_key_type(), connection_entry::mssfix, options::peer_id, connection_entry::proto, PROTO_UDP, options::shared_secret_file, options::tls_client, connection_entry::tun_mtu, and options::use_peer_id.
Referenced by main().
|
static |
Definition at line 222 of file test_crypto.c.
References compress_options::alg, options::authname, calc_options_string_link_mtu(), options::ce, options::ciphername, options::comp, COMP_ALG_LZO, COMP_ALG_UNDEF, http-client::f, connection_entry::fragment, options::gc, gc_free(), gc_new(), connection_entry::proto, PROTO_TCP_CLIENT, PROTO_UDP, options::pull, options::shared_secret_file, connection_entry::socks_proxy_server, options::tls_auth_file, options::tls_client, and connection_entry::tun_mtu.
Referenced by main().
|
static |
Definition at line 73 of file test_crypto.c.
References cipher_kt_name(), and cipher_valid().
Referenced by test_cipher_names().
|
static |
Definition at line 174 of file test_crypto.c.
Referenced by crypto_test_hmac().
|
static |
Definition at line 140 of file test_crypto.c.
Referenced by crypto_test_hmac(), and crypto_test_tls_prf().
|
static |
Definition at line 173 of file test_crypto.c.
Referenced by crypto_test_hmac().
|
static |
Definition at line 44 of file test_crypto.c.
Referenced by crypto_pem_encode_decode_loopback().