OpenVPN
test_acc.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 "acc.h"
#include "test_acc.h"
#include "test_common.h"
#include "mock_msg.h"
#include "multi.h"
Include dependency graph for test_acc.c:

Go to the source code of this file.

Macros

#define MSG_PAYLOAD

Functions

bool send_control_channel_string_dowork (struct tls_session *session, const char *str, unsigned int msglevel)
void send_push_reply_auth_token (struct tls_multi *multi)
 Sends a push reply message only containin the auth-token to update the auth-token on the client.
void auth_set_client_reason (struct tls_multi *multi, const char *reason)
 Sets the reason why authentication of a client failed.
void test_acc_parse_client_messages (void **state)
void test_parse_acc_parameters (void **state)
void test_acc_common_protocols (void **state)
void test_acc_send_message (void **state)
void test_list_intersection (void **state)

Variables

char control_channel_message_sent [2048]

Macro Definition Documentation

◆ MSG_PAYLOAD

#define MSG_PAYLOAD
Value:
"FgMBARkBAAEVAwNanUalkEDDxLBpZw9JnjI3tBM" \
"r4engpg/cDgS48DMaxyCdbzofNjQJU9Y0DD66z/notFT0cF1d60nTS" \
"4md4OJwoQAwEwITAxMBwCzAMACfzKnMqMyqwCvALwCewCTAKABrwCP" \
"AJwBnwArAFAA5wAnAEwAzAQAAnP8BAAEAAAsABAMAAQIACgAWABQAH" \
"QAXAB4AGQAYAQABAQECAQMBBAAWAAAAFwAAAA0AMAAuBAMFAwYDCAc" \
"ICAgaCBsIHAgJCAoICwgECAUIBgQBBQEGAQMDAwEDAgQCBQIGAgArA" \
"AUEAwQDAwAtAAIBAQAzACYAJAAdACCk4Tz2PB/2FsxOfOIV4gn/NyJ" \
"93rQwityP9eKSijXgcQ=="

Definition at line 69 of file test_acc.c.

Referenced by test_acc_parse_client_messages().

Function Documentation

◆ auth_set_client_reason()

void auth_set_client_reason ( struct tls_multi * multi,
const char * client_reason )

Sets the reason why authentication of a client failed.

This be will send to the client when the AUTH_FAILED message is sent An example would be "SESSION: Token expired"

Parameters
multiThe multi tls struct
client_reasonThe string to send to the client as part of AUTH_FAILED

Definition at line 65 of file test_acc.c.

◆ send_control_channel_string_dowork()

bool send_control_channel_string_dowork ( struct tls_session * session,
const char * str,
unsigned int msglevel )

Definition at line 50 of file test_acc.c.

References assert_int_in_range, and control_channel_message_sent.

◆ send_push_reply_auth_token()

void send_push_reply_auth_token ( struct tls_multi * multi)

Sends a push reply message only containin the auth-token to update the auth-token on the client.

Always pushes to the active session

Parameters
multi- The tls_multi structure belonging to the instance to push to

Definition at line 60 of file test_acc.c.

◆ test_acc_common_protocols()

◆ test_acc_parse_client_messages()

◆ test_acc_send_message()

◆ test_list_intersection()

void test_list_intersection ( void ** state)

Definition at line 323 of file test_acc.c.

References buf_cstr(), buf_len(), gc, gc_free(), gc_new(), and get_list_intersection().

Referenced by main().

◆ test_parse_acc_parameters()

void test_parse_acc_parameters ( void ** state)

Definition at line 175 of file test_acc.c.

References gc, gc_free(), gc_new(), and parse_acc_parameters().

Referenced by main().

Variable Documentation

◆ control_channel_message_sent

char control_channel_message_sent[2048]

Definition at line 46 of file test_acc.c.

Referenced by send_control_channel_string_dowork(), and test_acc_send_message().