Fix a bug in the new PACKET implementation
[openssl.git] / test / testca
index a28402f9ca79fa2187d1c19b808066637d3c7cd0..452558bfc64b013716e8193595d352c5ac08b4b9 100644 (file)
@@ -1,44 +1,31 @@
 #!/bin/sh
 
-SH="/bin/sh"
-PATH=../apps:$PATH
-export SH PATH
+set -e
 
-SSLEAY_CONFIG="-config CAss.cnf"
-export SSLEAY_CONFIG
-
-/bin/rm -fr demoCA
-$SH ../apps/CA.sh -newca <<EOF
-EOF
+PERL="$1"
 
-if [ $? != 0 ]; then
-       exit 1;
+if test "$OSTYPE" = msdosdjgpp; then
+    PATH="../apps\;$PATH"
+else
+    PATH="../apps:$PATH"
 fi
+export PATH
 
-SSLEAY_CONFIG="-config Uss.cnf"
-export SSLEAY_CONFIG
-$SH ../apps/CA.sh -newreq
-if [ $? != 0 ]; then
-       exit 1;
-fi
+export SSLEAY_CONFIG OPENSSL
 
+/bin/rm -fr demoCA
 
-SSLEAY_CONFIG="-config ../apps/ssleay.cnf"
-export SSLEAY_CONFIG
-$SH ../apps/CA.sh -sign  <<EOF
-y
-y
-EOF
-if [ $? != 0 ]; then
-       exit 1;
-fi
+SSLEAY_CONFIG="-config CAss.cnf"
+OPENSSL="`pwd`/../util/opensslwrap.sh"
 
+$PERL ../apps/CA.pl -newca </dev/null
 
-$SH ../apps/CA.sh -verify newcert.pem
-if [ $? != 0 ]; then
-       exit 1;
-fi
+SSLEAY_CONFIG="-config Uss.cnf"
+$PERL ../apps/CA.pl -newreq
 
-/bin/rm -fr demoCA newcert.pem newreq.pem
-#usage: CA -newcert|-newreq|-newca|-sign|-verify
+SSLEAY_CONFIG="-config ../apps/openssl.cnf"
+yes | $PERL ../apps/CA.pl -sign
+
+$PERL ../apps/CA.pl -verify newcert.pem
 
+/bin/rm -fr demoCA newcert.pem newreq.pem