use lib bldtop_dir('.');
my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
+my $config_path = abs_path(srctop_file("test", $no_fips ? "default.cnf"
+ : "default-and-fips.cnf"));
plan tests => 1;
if ($no_fips) {
- $ENV{OPENSSL_CONF} = abs_path(srctop_file("test", "default.cnf"));
- ok(run(test(["threadstest", data_dir()])), "running test_threads");
+ ok(run(test(["threadstest", "-config", $config_path, data_dir()])),
+ "running test_threads");
} else {
- $ENV{OPENSSL_CONF} = abs_path(srctop_file("test", "default-and-fips.cnf"));
- ok(run(test(["threadstest", "-fips", data_dir()])), "running test_threads");
+ ok(run(test(["threadstest", "-fips", "-config", $config_path, data_dir()])),
+ "running test_threads with FIPS");
}
static int do_fips = 0;
static char *privkey;
+static char *config_file = NULL;
#if !defined(OPENSSL_THREADS) || defined(CRYPTO_TDEBUG)
#endif
multi_success = 1;
- multi_libctx = OSSL_LIB_CTX_new();
- if (!TEST_ptr(multi_libctx))
- goto err;
+ if (!TEST_true(test_get_libctx(&multi_libctx, NULL, config_file,
+ NULL, NULL)))
+ return 0;
+
prov = OSSL_PROVIDER_load(multi_libctx, (idx == 1) ? "fips" : "default");
if (!TEST_ptr(prov))
goto err;
typedef enum OPTION_choice {
OPT_ERR = -1,
OPT_EOF = 0,
- OPT_FIPS,
+ OPT_FIPS, OPT_CONFIG_FILE,
OPT_TEST_ENUM
} OPTION_CHOICE;
static const OPTIONS options[] = {
OPT_TEST_OPTIONS_DEFAULT_USAGE,
{ "fips", OPT_FIPS, '-', "Test the FIPS provider" },
+ { "config", OPT_CONFIG_FILE, '<',
+ "The configuration file to use for the libctx" },
{ NULL }
};
return options;
case OPT_FIPS:
do_fips = 1;
break;
+ case OPT_CONFIG_FILE:
+ config_file = opt_arg();
+ break;
case OPT_TEST_CASES:
break;
default: