aboutsummaryrefslogtreecommitdiffstats
path: root/test/testgen
blob: f2db42cb247c84f89aee7c4503ea610e5920644b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

T=testcert
KEY=512
CA=../certs/testca.pem

/bin/rm -f $T.1 $T.2 $T.key

PATH=../apps:$PATH;
export PATH

echo "generating certificate request"

echo "string to make the random number generator think it has entropy" >> ./.rnd

if ../apps/openssl list-standard-commands | grep '^rsa$' >/dev/null; then
  req_new='-new'
  echo "There should be a 2 sequences of .'s and some +'s."
  echo "There should not be more that at most 80 per line"
else
  req_new='-newkey dsa:../apps/dsa512.pem'
fi

echo "This could take some time."

../apps/openssl req -config test.cnf $req_new -out testreq.pem
if [ $? != 0 ]; then
echo problems creating request
exit 1
fi

../apps/openssl req -config test.cnf -verify -in testreq.pem -noout
if [ $? != 0 ]; then
echo signature on req is wrong
exit 1
fi

exit 0