7 use File::Path 2.00 qw/rmtree/;
8 use OpenSSL::Test qw/:DEFAULT cmdstr srctop_file/;
12 $ENV{OPENSSL} = cmdstr(app(["openssl"]));
14 srctop_file("apps", $^O eq "VMS" ? "openssl-vms.cnf" : "openssl.cnf");
16 rmtree("demoCA", { safe => 0 });
20 $ENV{OPENSSL_CONFIG} = "-config ".srctop_file("test", "CAss.cnf");
21 skip "failed creating CA structure", 3
22 if !ok(run(perlapp(["CA.pl","-newca"], stdin => undef)),
23 'creating CA structure');
25 $ENV{OPENSSL_CONFIG} = "-config ".srctop_file("test", "Uss.cnf");
26 skip "failed creating new certificate request", 2
27 if !ok(run(perlapp(["CA.pl","-newreq"])),
28 'creating CA structure');
30 $ENV{OPENSSL_CONFIG} = "-config ".$std_openssl_cnf;
31 skip "failed to sign certificate request", 1
32 if !is(yes(cmdstr(perlapp(["CA.pl", "-sign"]))), 0,
33 'signing certificate request');
35 ok(run(perlapp(["CA.pl", "-verify", "newcert.pem"])),
36 'verifying new certificate');
40 rmtree("demoCA", { safe => 0 });
41 unlink "newcert.pem", "newreq.pem";
46 open(PIPE, "|-", join(" ",@_));
47 local $SIG{PIPE} = "IGNORE";
48 1 while $cntr-- > 0 && print PIPE "y\n";