OpenVPN
|
#include "syshead.h"
#include "manage.h"
#include <stdlib.h>
#include <string.h>
#include <setjmp.h>
#include <cmocka.h>
#include "test_common.h"
#include "misc.c"
Go to the source code of this file.
Functions | |
bool | query_user_exec_builtin (void) |
Executes a configured setup, using the built-in method for querying the user. More... | |
void | management_auth_failure (struct management *man, const char *type, const char *reason) |
bool | management_query_user_pass (struct management *man, struct user_pass *up, const char *type, const unsigned int flags, const char *static_challenge) |
int | parse_line (const char *line, char **p, const int n, const char *file, const int line_num, int msglevel, struct gc_arena *gc) |
static void | reset_user_pass (struct user_pass *up) |
static void | test_get_user_pass_defined (void **state) |
static void | test_get_user_pass_needok (void **state) |
static void | test_get_user_pass_inline_creds (void **state) |
static void | test_get_user_pass_authfile_stdin (void **state) |
static void | test_get_user_pass_authfile_file (void **state) |
static void | test_get_user_pass_dynamic_challenge (void **state) |
static void | test_get_user_pass_static_challenge (void **state) |
int | main (void) |
Variables | |
struct management * | management |
const struct CMUnitTest | user_pass_tests [] |
int main | ( | void | ) |
Definition at line 342 of file test_user_pass.c.
References openvpn_unit_test_setup(), and user_pass_tests.
void management_auth_failure | ( | struct management * | man, |
const char * | type, | ||
const char * | reason | ||
) |
Definition at line 60 of file test_user_pass.c.
bool management_query_user_pass | ( | struct management * | man, |
struct user_pass * | up, | ||
const char * | type, | ||
const unsigned int | flags, | ||
const char * | static_challenge | ||
) |
Definition at line 65 of file test_user_pass.c.
References alloc_buf_gc(), blank_up, BOOL_CAST, BSTR, buf_printf(), CLEAR, management::connection, user_pass::defined, gc_free(), gc_new(), GET_USER_PASS_NEED_OK, GET_USER_PASS_NEED_STR, GET_USER_PASS_PASSWORD_ONLY, GET_USER_PASS_STATIC_CHALLENGE_ECHO, M_CLIENT, man_check_for_signals(), man_standalone_event_loop(), man_standalone_ok(), man_wait_for_client_connection(), msg, MWCC_PASSWORD_WAIT, user_pass::nocache, user_pass::password, management::persist, secure_memzero(), man_persist::special_state_msg, man_persist::standalone_disabled, man_connection::up_query, UP_QUERY_DISABLED, man_connection::up_query_mode, UP_QUERY_NEED_OK, UP_QUERY_NEED_STR, UP_QUERY_PASS, man_connection::up_query_type, UP_QUERY_USER_PASS, and user_pass::username.
int parse_line | ( | const char * | line, |
char ** | p, | ||
const int | n, | ||
const char * | file, | ||
const int | line_num, | ||
int | msglevel, | ||
struct gc_arena * | gc | ||
) |
Definition at line 76 of file test_user_pass.c.
bool query_user_exec_builtin | ( | void | ) |
Executes a configured setup, using the built-in method for querying the user.
This method uses the console/TTY directly.
setup | Pointer to the setup defining what to ask the user |
Executes a configured setup, using the built-in method for querying the user.
Default method for querying user using default stdin/stdout on a console. This needs to be available as a backup interface for the alternative implementations in case they cannot query through their implementation specific methods.
If no alternative implementation is declared, a wrapper in console.h will ensure query_user_exec() will call this function instead.
Definition at line 48 of file test_user_pass.c.
References query_user, QUERY_USER_NUMSLOTS, and _query_user::response.
Referenced by query_user_exec(), test_get_user_pass_authfile_file(), test_get_user_pass_authfile_stdin(), test_get_user_pass_dynamic_challenge(), test_get_user_pass_inline_creds(), test_get_user_pass_needok(), and test_get_user_pass_static_challenge().
|
static |
Definition at line 85 of file test_user_pass.c.
References user_pass::defined, user_pass::nocache, user_pass::password, user_pass::token_defined, and user_pass::username.
Referenced by test_get_user_pass_authfile_file(), test_get_user_pass_authfile_stdin(), test_get_user_pass_defined(), test_get_user_pass_dynamic_challenge(), test_get_user_pass_inline_creds(), test_get_user_pass_needok(), and test_get_user_pass_static_challenge().
|
static |
Definition at line 232 of file test_user_pass.c.
References user_pass::defined, get_user_pass_cr(), GET_USER_PASS_PASSWORD_ONLY, openvpn_test_get_srcdir_dir(), user_pass::password, query_user, query_user_exec_builtin(), reset_user_pass(), and user_pass::username.
|
static |
Definition at line 203 of file test_user_pass.c.
References user_pass::defined, get_user_pass_cr(), GET_USER_PASS_PASSWORD_ONLY, user_pass::password, query_user, query_user_exec_builtin(), reset_user_pass(), and user_pass::username.
|
static |
Definition at line 95 of file test_user_pass.c.
References user_pass::defined, get_user_pass_cr(), and reset_user_pass().
|
static |
Definition at line 274 of file test_user_pass.c.
References user_pass::defined, get_user_pass_cr(), GET_USER_PASS_DYNAMIC_CHALLENGE, user_pass::password, query_user, query_user_exec_builtin(), reset_user_pass(), and user_pass::username.
|
static |
Definition at line 132 of file test_user_pass.c.
References user_pass::defined, get_user_pass_cr(), GET_USER_PASS_INLINE_CREDS, GET_USER_PASS_PASSWORD_ONLY, user_pass::password, query_user, query_user_exec_builtin(), reset_user_pass(), and user_pass::username.
|
static |
Definition at line 104 of file test_user_pass.c.
References user_pass::defined, get_user_pass_cr(), GET_USER_PASS_NEED_OK, user_pass::password, query_user, query_user_exec_builtin(), and reset_user_pass().
|
static |
Definition at line 291 of file test_user_pass.c.
References user_pass::defined, get_user_pass_cr(), GET_USER_PASS_INLINE_CREDS, GET_USER_PASS_STATIC_CHALLENGE, user_pass::password, query_user, query_user_exec_builtin(), reset_user_pass(), and user_pass::username.
struct management* management |
Definition at line 44 of file test_user_pass.c.
const struct CMUnitTest user_pass_tests[] |
Definition at line 329 of file test_user_pass.c.
Referenced by main().