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