consistent test-start logging
[openssl.git] / test / testgen
1 #!/bin/sh
2
3 T=testcert
4 KEY=512
5 CA=../certs/testca.pem
6 OPENSSL_CONF=/dev/null ; export OPENSSL_CONF
7
8 /bin/rm -f $T.1 $T.2 $T.key
9
10 if test "$OSTYPE" = msdosdjgpp; then
11     PATH=../apps\;$PATH;
12 else
13     PATH=../apps:$PATH;
14 fi
15 export PATH
16
17 echo "generating certificate request"
18
19 echo "string to make the random number generator think it has entropy" >> ./.rnd
20
21 if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
22   req_new='-newkey dsa:../apps/dsa512.pem'
23 else
24   req_new='-new'
25   echo "There should be a 2 sequences of .'s and some +'s."
26   echo "There should not be more that at most 80 per line"
27 fi
28
29 echo "This could take some time."
30
31 rm -f testkey.pem testreq.pem
32
33 ../util/shlib_wrap.sh ../apps/openssl req -config test.cnf $req_new -out testreq.pem
34 if [ $? != 0 ]; then
35 echo problems creating request
36 exit 1
37 fi
38
39 ../util/shlib_wrap.sh ../apps/openssl req -config test.cnf -verify -in testreq.pem -noout
40 if [ $? != 0 ]; then
41 echo signature on req is wrong
42 exit 1
43 fi
44
45 exit 0