diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-10-19 22:34:53 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-10-19 22:34:53 +0000 |
commit | 5e4eb9954b415fd685bfda69603bec52c5843778 (patch) | |
tree | 5a131d77836b3d292f151b236da15e3d99b60098 /fips/fips_test_suite.c | |
parent | 227a822ab628267b5fd1b168a0a0bd58482b35ef (diff) |
add authentication parameter to FIPS_module_mode_set
Diffstat (limited to 'fips/fips_test_suite.c')
-rw-r--r-- | fips/fips_test_suite.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fips/fips_test_suite.c b/fips/fips_test_suite.c index 0046b9b0d5..bca185666c 100644 --- a/fips/fips_test_suite.c +++ b/fips/fips_test_suite.c @@ -1002,6 +1002,7 @@ int main(int argc,char **argv) int do_drbg_stick = 0; int no_exit = 0; int no_dh = 0; + char *pass = FIPS_AUTH_USER_PASS; FIPS_post_set_callback(post_cb); @@ -1077,13 +1078,19 @@ int main(int argc,char **argv) do_drbg_stick = 1; no_exit = 1; printf("DRBG test with stuck continuous test...\n"); + } else if (!strcmp(argv[1], "user")) { + pass = FIPS_AUTH_USER_PASS; + } else if (!strcmp(argv[1], "officer")) { + pass = FIPS_AUTH_OFFICER_PASS; + } else if (!strcmp(argv[1], "badpass")) { + pass = "bad invalid password"; } else { printf("Bad argument \"%s\"\n", argv[1]); exit(1); } if (!no_exit) { fips_algtest_init_nofips(); - if (!FIPS_module_mode_set(1)) { + if (!FIPS_module_mode_set(1, pass)) { printf("Power-up self test failed\n"); exit(1); } @@ -1105,7 +1112,7 @@ int main(int argc,char **argv) /* Power-up self test */ ERR_clear_error(); - test_msg("2. Automatic power-up self test", FIPS_module_mode_set(1)); + test_msg("2. Automatic power-up self test", FIPS_module_mode_set(1, pass)); if (!FIPS_module_mode()) exit(1); if (do_drbg_stick) |