make sure .rnd exists
[openssl.git] / test / testss
index 36c792251e259f4d747f499aa356c44240c1260d..8d3557f356d9a1697d874e105eb87c3d5c36e41b 100644 (file)
@@ -1,9 +1,10 @@
 #!/bin/sh
 
-digest='-mdc2'
+digest='-md5'
 reqcmd="../apps/openssl req"
 x509cmd="../apps/openssl x509 $digest"
 verifycmd="../apps/openssl verify"
+dummycnf="../apps/openssl.cnf"
 
 CAkey="keyCA.ss"
 CAcert="certCA.ss"
@@ -18,7 +19,16 @@ Ucert="certU.ss"
 
 echo
 echo "make a certificate request using 'req'"
-$reqcmd -config $CAconf -out $CAreq -keyout $CAkey -new #>err.ss
+
+echo "string to make the random number generator think it has entropy" >> ./.rnd
+
+if ../apps/openssl no-rsa; then
+  req_new='-newkey dsa:../apps/dsa512.pem'
+else
+  req_new='-new'
+fi
+
+$reqcmd -config $CAconf -out $CAreq -keyout $CAkey $req_new #>err.ss
 if [ $? != 0 ]; then
        echo "error using 'req' to generate a certificate request"
        exit 1
@@ -39,13 +49,13 @@ if [ $? != 0 ]; then
        exit 1
 fi
 
-$reqcmd -verify -in $CAreq -noout
+$reqcmd -config $dummycnf -verify -in $CAreq -noout
 if [ $? != 0 ]; then
        echo first generated request is invalid
        exit 1
 fi
 
-$reqcmd -verify -in $CAreq2 -noout
+$reqcmd -config $dummycnf -verify -in $CAreq2 -noout
 if [ $? != 0 ]; then
        echo second generated request is invalid
        exit 1
@@ -59,7 +69,7 @@ fi
 
 echo
 echo "make another certificate request using 'req'"
-$reqcmd -config $Uconf -out $Ureq -keyout $Ukey -new >err.ss
+$reqcmd -config $Uconf -out $Ureq -keyout $Ukey $req_new >err.ss
 if [ $? != 0 ]; then
        echo "error using 'req' to generate a certificate request"
        exit 1