# All these are modified inside indir further down. They need to exist
# here, however, to be available in all subroutines.
+my $openssl_conf;
my $testtsa;
my $CAtsa;
-my @RUN = ("openssl", "ts");
+my @RUN;
sub create_tsa_cert {
my $INDEX = shift;
my $r = 1;
$ENV{TSDNSECT} = "ts_cert_dn";
- ok(run(app(["openssl", "req", "-new",
+ ok(run(app(["openssl", "req", "-config", $openssl_conf, "-new",
"-out", "tsa_req${INDEX}.pem",
"-keyout", "tsa_key${INDEX}.pem"])));
note "using extension $EXT";
"-out", "tsa_cert${INDEX}.pem",
"-CA", "tsaca.pem", "-CAkey", "tsacakey.pem",
"-CAcreateserial",
- "-extfile", $ENV{OPENSSL_CONF}, "-extensions", $EXT])));
+ "-extfile", $openssl_conf, "-extensions", $EXT])));
}
sub create_time_stamp_response {
note "setting up TSA test directory";
indir "tsa" => sub
{
- $ENV{OPENSSL_CONF} = srctop_file("test", "CAtsa.cnf");
- # Because that's what ../apps/CA.pl really looks at
- $ENV{OPENSSL_CONFIG} = "-config ".$ENV{OPENSSL_CONF};
- $ENV{OPENSSL} = cmdstr(app(["openssl"]), display => 1);
+ $openssl_conf = srctop_file("test", "CAtsa.cnf");
$testtsa = srctop_file("test", "recipes", "80-test_tsa.t");
$CAtsa = srctop_file("test", "CAtsa.cnf");
+ @RUN = ("openssl", "ts", "-config", $openssl_conf);
+
+ # ../apps/CA.pl needs these
+ $ENV{OPENSSL_CONFIG} = "-config $openssl_conf";
+ $ENV{OPENSSL} = cmdstr(app(["openssl"]), display => 1);
SKIP: {
$ENV{TSDNSECT} = "ts_ca_dn";
skip "failed", 19
- unless ok(run(app(["openssl", "req", "-new", "-x509", "-nodes",
+ unless ok(run(app(["openssl", "req", "-config", $openssl_conf,
+ "-new", "-x509", "-nodes",
"-out", "tsaca.pem", "-keyout", "tsacakey.pem"])),
'creating a new CA for the TSA tests');