2 # Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
14 use File::Path 2.00 qw/rmtree/;
15 use OpenSSL::Test qw/:DEFAULT cmdstr srctop_file/;
19 $ENV{OPENSSL} = cmdstr(app(["openssl"]), display => 1);
21 srctop_file("apps", $^O eq "VMS" ? "openssl-vms.cnf" : "openssl.cnf");
23 rmtree("demoCA", { safe => 0 });
27 $ENV{OPENSSL_CONFIG} = '-config "'.srctop_file("test", "CAss.cnf").'"';
28 skip "failed creating CA structure", 3
29 if !ok(run(perlapp(["CA.pl","-newca"], stdin => undef)),
30 'creating CA structure');
32 $ENV{OPENSSL_CONFIG} = '-config "'.srctop_file("test", "Uss.cnf").'"';
33 skip "failed creating new certificate request", 2
34 if !ok(run(perlapp(["CA.pl","-newreq"])),
35 'creating CA structure');
37 $ENV{OPENSSL_CONFIG} = '-config "'.$std_openssl_cnf.'"';
38 skip "failed to sign certificate request", 1
39 if !is(yes(cmdstr(perlapp(["CA.pl", "-sign"]))), 0,
40 'signing certificate request');
42 ok(run(perlapp(["CA.pl", "-verify", "newcert.pem"])),
43 'verifying new certificate');
47 rmtree("demoCA", { safe => 0 });
48 unlink "newcert.pem", "newreq.pem";
53 open(PIPE, "|-", join(" ",@_));
54 local $SIG{PIPE} = "IGNORE";
55 1 while $cntr-- > 0 && print PIPE "y\n";