OpenVPN
Functions | Variables
test_crypto.c File Reference
#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 "ssl_backend.h"
#include "mock_msg.h"
Include dependency graph for test_crypto.c:

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)
 
int main (void)
 

Variables

static const char testtext [] = "Dummy text to test PEM encoding"
 
static uint8_t good_prf [32]
 

Function Documentation

◆ crypto_pem_encode_decode_loopback()

static void crypto_pem_encode_decode_loopback ( void **  state)
static

◆ crypto_test_tls_prf()

static void crypto_test_tls_prf ( void **  state)
static

Definition at line 145 of file test_crypto.c.

References assert_memory_equal, good_prf, and ssl_tls1_PRF().

Referenced by main().

◆ crypto_translate_cipher_names()

static void crypto_translate_cipher_names ( void **  state)
static

Definition at line 127 of file test_crypto.c.

References test_cipher_names().

Referenced by main().

◆ main()

int main ( void  )

◆ test_cipher_names()

static void test_cipher_names ( const char *  ciphername,
const char *  openvpn_name 
)
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().

◆ test_translate_cipher()

static void test_translate_cipher ( const char *  ciphername,
const char *  openvpn_name 
)
static

Definition at line 73 of file test_crypto.c.

References assert_string_equal, cipher_kt_get(), and cipher_kt_name().

Referenced by test_cipher_names().

Variable Documentation

◆ good_prf

uint8_t good_prf[32]
static
Initial value:
= {0xd9, 0x8c, 0x85, 0x18, 0xc8, 0x5e, 0x94, 0x69,
0x27, 0x91, 0x6a, 0xcf, 0xc2, 0xd5, 0x92, 0xfb,
0xb1, 0x56, 0x7e, 0x4b, 0x4b, 0x14, 0x59, 0xe6,
0xa9, 0x04, 0xac, 0x2d, 0xda, 0xb7, 0x2d, 0x67}

Definition at line 140 of file test_crypto.c.

Referenced by crypto_test_tls_prf().

◆ testtext

const char testtext[] = "Dummy text to test PEM encoding"
static

Definition at line 44 of file test_crypto.c.

Referenced by crypto_pem_encode_decode_loopback().