8961cf8448eba18ae6b61c938a312f49004c267a
[openssl.git] / test / testca
1 #!/bin/sh
2
3 PERL="$1"
4
5 if test "$OSTYPE" = msdosdjgpp; then
6     PATH="../apps\;$PATH"
7 else
8     PATH="../apps:$PATH"
9 fi
10 export PATH
11
12 SSLEAY_CONFIG="-config CAss.cnf"
13 export SSLEAY_CONFIG
14
15 OPENSSL="`pwd`/../util/opensslwrap.sh"
16 export OPENSSL
17
18 /bin/rm -fr demoCA
19
20 # Could do '...CA.pl -newca || exot 1 << EOF
21 # EOF' but that seems too obscure to me. :)
22 OPENSSL_CONFIG=/dev/null $PERL ../apps/CA.pl -newca <<EOF
23 EOF
24 [ $? == 0 ] || exit 1
25
26 SSLEAY_CONFIG="-config Uss.cnf"
27 export SSLEAY_CONFIG
28 $PERL ../apps/CA.pl -newreq || exit 1
29
30 SSLEAY_CONFIG="-config ../apps/openssl.cnf"
31 export SSLEAY_CONFIG
32
33 # Same comment here.
34 $PERL ../apps/CA.pl -sign  <<EOF
35 y
36 y
37 EOF
38 [ $? == 0 ] || exit 1
39
40
41 $PERL ../apps/CA.pl -verify newcert.pem || exit 1
42
43 /bin/rm -fr demoCA newcert.pem newreq.pem