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) |
Loop through configured query_user slots, using the built-in method for querying the user. | |
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) |
bool | protect_buffer_win32 (char *buf, size_t len) |
Encrypt a region of memory using CryptProtectMemory() with access restricted to the current process. | |
bool | unprotect_buffer_win32 (char *buf, size_t len) |
Decrypt a previously encrypted region of memory using CryptUnProtectMemory() with access restricted to the current process. | |
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 375 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 63 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 68 of file test_user_pass.c.
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 79 of file test_user_pass.c.
bool protect_buffer_win32 | ( | char * | buf, |
size_t | len | ||
) |
Encrypt a region of memory using CryptProtectMemory() with access restricted to the current process.
Definition at line 87 of file test_user_pass.c.
bool query_user_exec_builtin | ( | void | ) |
Loop through configured query_user slots, using the built-in method for querying the user.
This method uses the console/TTY directly.
Loop through configured query_user slots, 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 51 of file test_user_pass.c.
References get_console_input(), 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 100 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 247 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 218 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 110 of file test_user_pass.c.
References user_pass::defined, get_user_pass_cr(), and reset_user_pass().
|
static |
Definition at line 289 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 147 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 119 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 306 of file test_user_pass.c.
References user_pass::defined, get_user_pass_cr(), GET_USER_PASS_INLINE_CREDS, GET_USER_PASS_STATIC_CHALLENGE, GET_USER_PASS_STATIC_CHALLENGE_CONCAT, user_pass::password, query_user, query_user_exec_builtin(), reset_user_pass(), and user_pass::username.
bool unprotect_buffer_win32 | ( | char * | buf, |
size_t | len | ||
) |
Decrypt a previously encrypted region of memory using CryptUnProtectMemory() with access restricted to the current process.
Definition at line 93 of file test_user_pass.c.
struct management* management |
Definition at line 40 of file test_user_pass.c.
const struct CMUnitTest user_pass_tests[] |
Definition at line 362 of file test_user_pass.c.
Referenced by main().