OpenVPN
test_user_pass.c
Go to the documentation of this file.
1/*
2 * OpenVPN -- An application to securely tunnel IP networks
3 * over a single UDP port, with support for SSL/TLS-based
4 * session authentication and key exchange,
5 * packet encryption, packet authentication, and
6 * packet compression.
7 *
8 * Copyright (C) 2023-2026 OpenVPN Inc <sales@openvpn.net>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by the
12 * Free Software Foundation, either version 2 of the License,
13 * or (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifdef HAVE_CONFIG_H
25#include "config.h"
26#endif
27
28#include "syshead.h"
29#include "manage.h"
30
31#include <stdlib.h>
32#include <string.h>
33#include <setjmp.h>
34#include <cmocka.h>
35#include "test_common.h"
36
37#include "misc.c"
38
39struct management *management; /* global */
40
41/* mocking */
42#if defined(ENABLE_SYSTEMD)
43bool
44query_user_exec_systemd(void)
45{
47}
48#endif
49
50bool
52{
53 /* Loop through configured query_user slots */
54 for (int i = 0; i < QUERY_USER_NUMSLOTS && query_user[i].response != NULL; i++)
55 {
56 check_expected_ptr(query_user[i].prompt);
57 strlcpy(query_user[i].response, mock_ptr_type(char *), query_user[i].response_len);
58 }
59
60 return mock();
61}
62
63void
64management_auth_failure(const struct management *man, const char *type, const char *reason)
65{
66 assert_true(0);
67}
68bool
69management_query_user_pass(struct management *man, struct user_pass *up, const char *type,
70 const unsigned int flags, const char *static_challenge)
71{
72 assert_true(0);
73 return false;
74}
75/* stubs for some unused functions instead of pulling in too many dependencies */
76int
77parse_line(const char *line, char **p, const int n, const char *file, const int line_num,
78 msglvl_t msglevel, struct gc_arena *gc)
79{
80 assert_true(0);
81 return 0;
82}
83
84#ifdef _WIN32
85bool
86protect_buffer_win32(char *buf, DWORD len)
87{
88 return true;
89}
90
91bool
92unprotect_buffer_win32(char *buf, DWORD len)
93{
94 return true;
95}
96#endif
97
98/* tooling */
99static void
101{
102 up->defined = false;
103 up->token_defined = false;
104 up->nocache = false;
105 strcpy(up->username, "user");
106 strcpy(up->password, "password");
107}
108
109static void
111{
112 struct user_pass up = { 0 };
113 reset_user_pass(&up);
114 up.defined = true;
115 assert_true(get_user_pass_cr(&up, NULL, "UT", 0, NULL));
116}
117
118static void
120{
121 struct user_pass up = { 0 };
122 reset_user_pass(&up);
123 unsigned int flags = GET_USER_PASS_NEED_OK;
124
125 expect_string(query_user_exec_builtin, query_user[i].prompt, "NEED-OK|UT|user:");
126 will_return(query_user_exec_builtin, "");
127 will_return(query_user_exec_builtin, true);
128 /*FIXME: query_user_exec() called even though nothing queued */
129 will_return(query_user_exec_builtin, true);
130 assert_true(get_user_pass_cr(&up, NULL, "UT", flags, NULL));
131 assert_true(up.defined);
132 assert_string_equal(up.password, "ok");
133
134 reset_user_pass(&up);
135
136 expect_string(query_user_exec_builtin, query_user[i].prompt, "NEED-OK|UT|user:");
137 will_return(query_user_exec_builtin, "cancel");
138 will_return(query_user_exec_builtin, true);
139 /*FIXME: query_user_exec() called even though nothing queued */
140 will_return(query_user_exec_builtin, true);
141 assert_true(get_user_pass_cr(&up, NULL, "UT", flags, NULL));
142 assert_true(up.defined);
143 assert_string_equal(up.password, "cancel");
144}
145
146static void
148{
149 struct user_pass up = { 0 };
150 reset_user_pass(&up);
151 unsigned int flags = GET_USER_PASS_INLINE_CREDS;
152
153 /*FIXME: query_user_exec() called even though nothing queued */
154 will_return(query_user_exec_builtin, true);
155 assert_true(get_user_pass_cr(&up, "iuser\nipassword", "UT", flags, NULL));
156 assert_true(up.defined);
157 assert_string_equal(up.username, "iuser");
158 assert_string_equal(up.password, "ipassword");
159
160 reset_user_pass(&up);
161
162 /* Test various valid characters */
163 /*FIXME: query_user_exec() called even though nothing queued */
164 will_return(query_user_exec_builtin, true);
165 /* FIXME? content after first two lines just ignored */
166 assert_true(
167 get_user_pass_cr(&up, "#iuser and 커뮤니티\n//ipasswörd!\nsome other content\nnot relevant",
168 "UT", flags, NULL));
169 assert_true(up.defined);
170 assert_string_equal(up.username, "#iuser and 커뮤니티");
171 assert_string_equal(up.password, "//ipasswörd!");
172
173 reset_user_pass(&up);
174
175 /* Test various invalid characters */
176 /*FIXME: query_user_exec() called even though nothing queued */
177 will_return(query_user_exec_builtin, true);
178 /*FIXME? allows arbitrary crap if c > 127 */
179 /*FIXME? silently removes control characters */
180 assert_true(get_user_pass_cr(&up, "\tiuser\r\nipass\xffwo\x1erd", "UT", flags, NULL));
181 assert_true(up.defined);
182 assert_string_equal(up.username, "iuser");
183 assert_string_equal(up.password, "ipass\xffword");
184
185 reset_user_pass(&up);
186
187 /*FIXME: query_user_exec() called even though nothing queued */
188 will_return(query_user_exec_builtin, true);
189 /*FIXME: silently removes control characters but does not error out */
190 assert_true(get_user_pass_cr(&up, "\t\n\t", "UT", flags, NULL));
191 assert_true(up.defined);
192 assert_string_equal(up.username, "");
193 assert_string_equal(up.password, "");
194
195 reset_user_pass(&up);
196
197 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:");
198 will_return(query_user_exec_builtin, "cpassword");
199 will_return(query_user_exec_builtin, true);
200 /* will try to retrieve missing password from stdin */
201 assert_true(get_user_pass_cr(&up, "iuser", "UT", flags, NULL));
202 assert_true(up.defined);
203 assert_string_equal(up.username, "iuser");
204 assert_string_equal(up.password, "cpassword");
205
206 reset_user_pass(&up);
207
209 /*FIXME: query_user_exec() called even though nothing queued */
210 will_return(query_user_exec_builtin, true);
211 assert_true(get_user_pass_cr(&up, "ipassword\n", "UT", flags, NULL));
212 assert_true(up.defined);
213 assert_string_equal(up.username, "user");
214 assert_string_equal(up.password, "ipassword");
215
216 reset_user_pass(&up);
217
219 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:");
220 will_return(query_user_exec_builtin, "cpassword");
221 will_return(query_user_exec_builtin, true);
222 /* will try to retrieve missing password from stdin */
223 assert_true(get_user_pass_cr(&up, "", "UT", flags, NULL));
224 assert_true(up.defined);
225 assert_string_equal(up.username, "user");
226 assert_string_equal(up.password, "cpassword");
227}
228
229/* NOTE: expect_assert_failure does not seem to work with MSVC */
230#ifndef _MSC_VER
231/* NOTE: leaks gc memory */
232static void
234{
235 struct user_pass up = { 0 };
236 reset_user_pass(&up);
237 unsigned int flags = GET_USER_PASS_INLINE_CREDS;
238
239 reset_user_pass(&up);
240
241 /*FIXME: query_user_exec() called even though nothing queued */
242 /*FIXME? username error thrown very late in stdin handling */
243 will_return(query_user_exec_builtin, true);
244 expect_assert_failure(get_user_pass_cr(&up, "\nipassword\n", "UT", flags, NULL));
245}
246#endif
247
248static void
250{
251 struct user_pass up = { 0 };
252 reset_user_pass(&up);
253 unsigned int flags = 0;
254
255 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Username:");
256 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:");
257 will_return(query_user_exec_builtin, "cuser");
258 will_return(query_user_exec_builtin, "cpassword");
259 will_return(query_user_exec_builtin, true);
260 assert_true(get_user_pass_cr(&up, "stdin", "UT", flags, NULL));
261 assert_true(up.defined);
262 assert_string_equal(up.username, "cuser");
263 assert_string_equal(up.password, "cpassword");
264
265 reset_user_pass(&up);
266
268 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:");
269 will_return(query_user_exec_builtin, "cpassword");
270 will_return(query_user_exec_builtin, true);
271 assert_true(get_user_pass_cr(&up, "stdin", "UT", flags, NULL));
272 assert_true(up.defined);
273 assert_string_equal(up.username, "user");
274 assert_string_equal(up.password, "cpassword");
275
276 reset_user_pass(&up);
277
279 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:");
280 will_return(query_user_exec_builtin, "");
281 will_return(query_user_exec_builtin, true);
282 /*FIXME? does not error out on empty password */
283 assert_true(get_user_pass_cr(&up, "stdin", "UT", flags, NULL));
284 assert_true(up.defined);
285 assert_string_equal(up.username, "user");
286 assert_string_equal(up.password, "");
287
288 reset_user_pass(&up);
289
291 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Username:");
292 will_return(query_user_exec_builtin, "cuser");
293 will_return(query_user_exec_builtin, true);
294 assert_true(get_user_pass_cr(&up, "stdin", "UT", flags, NULL));
295 assert_true(up.defined);
296 assert_string_equal(up.username, "cuser");
297 assert_string_equal(up.password, "[[BLANK]]");
298}
299
300/* NOTE: expect_assert_failure does not seem to work with MSVC */
301#ifndef _MSC_VER
302/* NOTE: leaks gc memory */
303static void
305{
306 struct user_pass up = { 0 };
307 reset_user_pass(&up);
308 unsigned int flags = 0;
309
310 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Username:");
311 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:");
312 will_return(query_user_exec_builtin, "");
313 will_return(query_user_exec_builtin, "cpassword");
314 will_return(query_user_exec_builtin, true);
315 expect_assert_failure(get_user_pass_cr(&up, "stdin", "UT", flags, NULL));
316}
317#endif
318
319static void
321{
322 struct user_pass up = { 0 };
323 reset_user_pass(&up);
324 unsigned int flags = 0;
325
326 char authfile[PATH_MAX] = { 0 };
327 openvpn_test_get_srcdir_dir(authfile, PATH_MAX, "input/user_pass.txt");
328
329 /*FIXME: query_user_exec() called even though nothing queued */
330 will_return(query_user_exec_builtin, true);
331 assert_true(get_user_pass_cr(&up, authfile, "UT", flags, NULL));
332 assert_true(up.defined);
333 assert_string_equal(up.username, "fuser");
334 assert_string_equal(up.password, "fpassword");
335
336 reset_user_pass(&up);
337
338 openvpn_test_get_srcdir_dir(authfile, PATH_MAX, "input/appears_empty.txt");
339 /*FIXME: query_user_exec() called even though nothing queued */
340 will_return(query_user_exec_builtin, true);
341 /*FIXME? does not error out */
342 assert_true(get_user_pass_cr(&up, authfile, "UT", flags, NULL));
343 assert_true(up.defined);
344 assert_string_equal(up.username, "");
345 assert_string_equal(up.password, "");
346
347 reset_user_pass(&up);
348
349 openvpn_test_get_srcdir_dir(authfile, PATH_MAX, "input/user_only.txt");
350 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:");
351 will_return(query_user_exec_builtin, "cpassword");
352 will_return(query_user_exec_builtin, true);
353 /* will try to retrieve missing password from stdin */
354 assert_true(get_user_pass_cr(&up, authfile, "UT", flags, NULL));
355 assert_true(up.defined);
356 assert_string_equal(up.username, "fuser");
357 assert_string_equal(up.password, "cpassword");
358
359 reset_user_pass(&up);
360
362 openvpn_test_get_srcdir_dir(authfile, PATH_MAX, "input/user_only.txt");
363 /*FIXME: query_user_exec() called even though nothing queued */
364 will_return(query_user_exec_builtin, true);
365 assert_true(get_user_pass_cr(&up, authfile, "UT", flags, NULL));
366 assert_true(up.defined);
367 assert_string_equal(up.username, "user");
368 assert_string_equal(up.password, "fuser");
369}
370
371static void
373{
374 struct gc_arena gc = gc_new();
375 const char *authfile = platform_create_temp_file(platform_get_tmp_dir(), "user_pass", &gc);
376 assert_non_null(authfile);
377 const size_t lengths[] = { USER_PASS_LEN - 2, USER_PASS_LEN - 1, USER_PASS_LEN + 10 };
378 const char *endings[] = { "", "\n", "\n\n", "\nfpassword\n", "\r\nfpassword\r\n" };
379
380 const bool inline_mode[] = { false, true };
381 for (size_t mode = 0; mode < SIZE(inline_mode); mode++)
382 {
383 const bool use_inline_creds = inline_mode[mode];
384 for (size_t i = 0; i < SIZE(lengths); i++)
385 {
386 for (size_t j = 0; j < SIZE(endings); j++)
387 {
388 struct user_pass up = { 0 };
389 char creds[USER_PASS_LEN + 64];
390 memset(creds, 'u', lengths[i]);
391 strcpy(creds + lengths[i], endings[j]);
392 if (!use_inline_creds)
393 {
394 FILE *fp = platform_fopen(authfile, "w");
395 assert_non_null(fp);
396 assert_true(fputs(creds, fp) >= 0);
397 assert_int_equal(fclose(fp), 0);
398 }
399
400 const bool missing_password = j < 3;
401 if (missing_password)
402 {
403 expect_string(query_user_exec_builtin, query_user[i].prompt,
404 "Enter UT Password:");
405 will_return(query_user_exec_builtin, "cpassword");
406 }
407 will_return(query_user_exec_builtin, true);
408 assert_true(get_user_pass_cr(&up, use_inline_creds ? creds : authfile, "UT",
409 use_inline_creds ? GET_USER_PASS_INLINE_CREDS : 0, NULL));
410 /* Truncation must not change where the password line starts. */
411 creds[lengths[i] < USER_PASS_LEN ? lengths[i] : USER_PASS_LEN - 1] = '\0';
412 assert_true(up.defined);
413 assert_string_equal(up.username, creds);
414 assert_string_equal(up.password,
415 missing_password ? "cpassword" : "fpassword");
416 }
417 }
418 }
419 assert_true(platform_unlink(authfile));
420 gc_free(&gc);
421}
422
423#ifdef ENABLE_MANAGEMENT
424static void
426{
427 struct user_pass up = { 0 };
428 reset_user_pass(&up);
429 const char *challenge = "CRV1:R,E:Om01u7Fh4LrGBS7uh0SWmzwabUiGiW6l:Y3Ix:Please enter token PIN";
430 unsigned int flags = GET_USER_PASS_DYNAMIC_CHALLENGE;
431
432 expect_string(query_user_exec_builtin, query_user[i].prompt,
433 "CHALLENGE: Please enter token PIN");
434 will_return(query_user_exec_builtin, "challenge_response");
435 will_return(query_user_exec_builtin, true);
436 assert_true(get_user_pass_cr(&up, NULL, "UT", flags, challenge));
437 assert_true(up.defined);
438 assert_string_equal(up.username, "cr1");
439 assert_string_equal(up.password, "CRV1::Om01u7Fh4LrGBS7uh0SWmzwabUiGiW6l::challenge_response");
440}
441
442static void
444{
445 struct user_pass up = { 0 };
446 reset_user_pass(&up);
447 const char *challenge = "Please enter token PIN";
448 unsigned int flags = GET_USER_PASS_STATIC_CHALLENGE;
449
450 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Username:");
451 will_return(query_user_exec_builtin, "cuser");
452 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:");
453 will_return(query_user_exec_builtin, "cpassword");
454 will_return(query_user_exec_builtin, true);
455 expect_string(query_user_exec_builtin, query_user[i].prompt,
456 "CHALLENGE: Please enter token PIN");
457 will_return(query_user_exec_builtin, "challenge_response");
458 will_return(query_user_exec_builtin, true);
459 assert_true(get_user_pass_cr(&up, NULL, "UT", flags, challenge));
460 assert_true(up.defined);
461 assert_string_equal(up.username, "cuser");
462 /* SCRV1:cpassword:challenge_response but base64-encoded */
463 assert_string_equal(up.password, "SCRV1:Y3Bhc3N3b3Jk:Y2hhbGxlbmdlX3Jlc3BvbnNl");
464
465 reset_user_pass(&up);
466
468
469 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Username:");
470 will_return(query_user_exec_builtin, "c1user");
471 expect_string(query_user_exec_builtin, query_user[i].prompt, "Enter UT Password:");
472 will_return(query_user_exec_builtin, "c1password");
473 will_return(query_user_exec_builtin, true);
474 expect_string(query_user_exec_builtin, query_user[i].prompt,
475 "CHALLENGE: Please enter token PIN");
476 will_return(query_user_exec_builtin, "0123456");
477 will_return(query_user_exec_builtin, true);
478 assert_true(get_user_pass_cr(&up, NULL, "UT", flags, challenge));
479 assert_true(up.defined);
480 assert_string_equal(up.username, "c1user");
481 /* password and response concatenated */
482 assert_string_equal(up.password, "c1password0123456");
483
484 reset_user_pass(&up);
485
487
488 /*FIXME: query_user_exec() called even though nothing queued */
489 will_return(query_user_exec_builtin, true);
490 expect_string(query_user_exec_builtin, query_user[i].prompt,
491 "CHALLENGE: Please enter token PIN");
492 will_return(query_user_exec_builtin, "challenge_response");
493 will_return(query_user_exec_builtin, true);
494 assert_true(get_user_pass_cr(&up, "iuser\nipassword", "UT", flags, challenge));
495 assert_true(up.defined);
496 assert_string_equal(up.username, "iuser");
497 /* SCRV1:ipassword:challenge_response but base64-encoded */
498 assert_string_equal(up.password, "SCRV1:aXBhc3N3b3Jk:Y2hhbGxlbmdlX3Jlc3BvbnNl");
499}
500#endif /* ENABLE_MANAGEMENT */
501
502/* NOTE: expect_assert_failure does not seem to work with MSVC */
503#ifndef _MSC_VER
504/* NOTE: leaks gc memory */
505static void
507{
508 struct user_pass up = { 0 };
509 reset_user_pass(&up);
510 unsigned int flags = 0;
511
512 char authfile[PATH_MAX] = { 0 };
513
514 openvpn_test_get_srcdir_dir(authfile, PATH_MAX, "input/empty.txt");
515 expect_assert_failure(get_user_pass_cr(&up, authfile, "UT", flags, NULL));
516
517 reset_user_pass(&up);
518
520 openvpn_test_get_srcdir_dir(authfile, PATH_MAX, "input/empty.txt");
521 expect_assert_failure(get_user_pass_cr(&up, authfile, "UT", flags, NULL));
522}
523#endif /* ifndef _MSC_VER */
524
525const struct CMUnitTest user_pass_tests[] = {
526 cmocka_unit_test(test_get_user_pass_defined),
527 cmocka_unit_test(test_get_user_pass_needok),
528 cmocka_unit_test(test_get_user_pass_inline_creds),
529 cmocka_unit_test(test_get_user_pass_authfile_stdin),
530 cmocka_unit_test(test_get_user_pass_authfile_file),
531 cmocka_unit_test(test_get_user_pass_long_username),
532#ifdef ENABLE_MANAGEMENT
533 cmocka_unit_test(test_get_user_pass_dynamic_challenge),
534 cmocka_unit_test(test_get_user_pass_static_challenge),
535#endif /* ENABLE_MANAGEMENT */
536#ifndef _MSC_VER
540#endif
541};
542
543int
544main(void)
545{
547 return cmocka_run_group_tests(user_pass_tests, NULL, NULL);
548}
static void gc_free(struct gc_arena *a)
Free all allocations in a garbage collection arena.
Definition buffer.h:1974
static struct gc_arena gc_new(void)
Allocate and return a new, empty garbage collection arena.
Definition buffer.h:1958
size_t strlcpy(char *dest, const char *src, size_t maxlen)
struct _query_user query_user[QUERY_USER_NUMSLOTS]
Global variable, declared in console.c.
Definition console.c:40
bool query_user_exec_builtin(void)
Loop through configured query_user slots, using the built-in method for querying the user.
#define QUERY_USER_NUMSLOTS
Definition console.h:41
bool get_user_pass_cr(struct user_pass *up, const char *auth_file, const char *prefix, const unsigned int flags, const char *auth_challenge)
Retrieves the user credentials from various sources depending on the flags.
Definition misc.c:201
#define USER_PASS_LEN
Definition misc.h:67
#define GET_USER_PASS_STATIC_CHALLENGE_CONCAT
indicates password and response should be concatenated
Definition misc.h:128
#define GET_USER_PASS_PASSWORD_ONLY
Definition misc.h:115
#define GET_USER_PASS_USERNAME_ONLY
indicate that only username should be prompted for auth-user-pass
Definition misc.h:130
#define GET_USER_PASS_INLINE_CREDS
indicates that auth_file is actually inline creds
Definition misc.h:126
#define GET_USER_PASS_STATIC_CHALLENGE
SCRV1 protocol – static challenge.
Definition misc.h:122
#define GET_USER_PASS_NEED_OK
Definition misc.h:116
#define GET_USER_PASS_DYNAMIC_CHALLENGE
CRV1 protocol – dynamic challenge.
Definition misc.h:121
#define SIZE(x)
Definition basic.h:29
unsigned int msglvl_t
Definition error.h:77
const char * platform_create_temp_file(const char *directory, const char *prefix, struct gc_arena *gc)
Create a temporary file in directory, returns the filename of the created file.
Definition platform.c:545
bool platform_unlink(const char *filename)
Definition platform.c:492
FILE * platform_fopen(const char *path, const char *mode)
Definition platform.c:505
const char * platform_get_tmp_dir(void)
Get a directory for temporary files.
Definition platform.c:591
Garbage collection arena used to keep track of dynamically allocated memory.
Definition buffer.h:127
bool token_defined
Definition misc.h:59
bool defined
Definition misc.h:56
char password[USER_PASS_LEN]
Definition misc.h:71
bool nocache
Definition misc.h:60
char username[USER_PASS_LEN]
Definition misc.h:70
static void openvpn_unit_test_setup(void)
Sets up the environment for unit tests like making both stderr and stdout non-buffered to avoid messa...
Definition test_common.h:63
static void openvpn_test_get_srcdir_dir(char *buf, size_t bufsize, const char *filename)
Helper function to get a file path from the unit test directory to open it or pass its path to anothe...
Definition test_common.h:86
struct gc_arena gc
Definition test_ssl.c:138
int parse_line(const char *line, char **p, const int n, const char *file, const int line_num, msglvl_t msglevel, struct gc_arena *gc)
static void reset_user_pass(struct user_pass *up)
const struct CMUnitTest user_pass_tests[]
bool query_user_exec_builtin(void)
Loop through configured query_user slots, using the built-in method for querying the user.
static void test_get_user_pass_long_username(void **state)
bool protect_buffer_win32(char *buf, DWORD len)
Encrypt a region of memory using CryptProtectMemory() with access restricted to the current process.
static void test_get_user_pass_authfile_file_assertions(void **state)
bool unprotect_buffer_win32(char *buf, DWORD len)
Decrypt a previously encrypted region of memory using CryptUnProtectMemory() with access restricted t...
static void test_get_user_pass_defined(void **state)
static void test_get_user_pass_static_challenge(void **state)
bool management_query_user_pass(struct management *man, struct user_pass *up, const char *type, const unsigned int flags, const char *static_challenge)
int main(void)
static void test_get_user_pass_authfile_stdin_assertions(void **state)
static void test_get_user_pass_authfile_stdin(void **state)
void management_auth_failure(const struct management *man, const char *type, const char *reason)
static void test_get_user_pass_needok(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_inline_creds(void **state)
static void test_get_user_pass_inline_creds_assertions(void **state)