7 use File::Spec::Functions qw/splitdir curdir catfile devnull/;
8 use File::Path qw/remove_tree/;
10 use OpenSSL::Test qw/:DEFAULT cmdstr top_file quotify/;
15 $ENV{OPENSSL} = cmdstr(app(["openssl"]));
16 my $CA_pl = top_file("apps", "CA.pl");
17 my $std_openssl_cnf = top_file("apps", "openssl.cnf");
19 ($perl) = quotify($perl) unless $^O eq "VMS"; # never quotify a command on VMS. Ever!
21 remove_tree("demoCA", { safe => 0 });
25 $ENV{SSLEAY_CONFIG} = "-config CAss.cnf";
26 skip "failed creating CA structure", 3
27 if !is(system("$perl ".$CA_pl." -newca < ".devnull()." 2>&1"), 0,
28 'creating CA structure');
30 $ENV{SSLEAY_CONFIG} = "-config Uss.cnf";
31 skip "failed creating new certificate request", 2
32 if !is(system("$perl ".$CA_pl." -newreq 2>&1"), 0,
33 'creating new certificate request');
35 $ENV{SSLEAY_CONFIG} = "-config ".$std_openssl_cnf;
36 skip "failed to sign certificate request", 1
37 if !is(yes("$perl ".$CA_pl." -sign 2>&1"), 0,
38 'signing certificate request');
40 is(system("$perl ".$CA_pl." -verify newcert.pem 2>&1"), 0,
41 'verifying new certificate');
45 remove_tree("demoCA", { safe => 0 });
46 unlink "newcert.pem", "newreq.pem";
50 open(PIPE, "|-", join(" ",@_));
51 local $SIG{PIPE} = "IGNORE";
52 1 while print PIPE "y\n";