Remove building with NOCRYPTO option
[minix.git] / crypto / external / bsd / openssl / dist / test / testfipsssl
blobc4836edc259ae083802473411338d6ea764d63c1
1 #!/bin/sh
3 if [ "$1" = "" ]; then
4 key=../apps/server.pem
5 else
6 key="$1"
7 fi
8 if [ "$2" = "" ]; then
9 cert=../apps/server.pem
10 else
11 cert="$2"
14 ciphers="DHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:AES256-SHA:EDH-RSA-DES-CBC3-SHA:EDH-DSS-DES-CBC3-SHA:DES-CBC3-SHA:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA:AES128-SHA:EXP1024-DHE-DSS-DES-CBC-SHA:EXP1024-DES-CBC-SHA:EDH-RSA-DES-CBC-SHA:EDH-DSS-DES-CBC-SHA:DES-CBC-SHA:EXP-EDH-RSA-DES-CBC-SHA:EXP-EDH-DSS-DES-CBC-SHA:EXP-DES-CBC-SHA"
16 ssltest="../util/shlib_wrap.sh ./ssltest -F -key $key -cert $cert -c_key $key -c_cert $cert -cipher $ciphers"
18 if ../util/shlib_wrap.sh ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then
19 dsa_cert=YES
20 else
21 dsa_cert=NO
24 if [ "$3" = "" ]; then
25 CA="-CApath ../certs"
26 else
27 CA="-CAfile $3"
30 if [ "$4" = "" ]; then
31 extra=""
32 else
33 extra="$4"
36 #############################################################################
38 echo test ssl3 is forbidden in FIPS mode
39 $ssltest -ssl3 $extra && exit 1
41 echo test ssl2 is forbidden in FIPS mode
42 $ssltest -ssl2 $extra && exit 1
44 echo test tls1
45 $ssltest -tls1 $extra || exit 1
47 echo test tls1 with server authentication
48 $ssltest -tls1 -server_auth $CA $extra || exit 1
50 echo test tls1 with client authentication
51 $ssltest -tls1 -client_auth $CA $extra || exit 1
53 echo test tls1 with both client and server authentication
54 $ssltest -tls1 -server_auth -client_auth $CA $extra || exit 1
56 echo test tls1 via BIO pair
57 $ssltest -bio_pair -tls1 $extra || exit 1
59 echo test tls1 with server authentication via BIO pair
60 $ssltest -bio_pair -tls1 -server_auth $CA $extra || exit 1
62 echo test tls1 with client authentication via BIO pair
63 $ssltest -bio_pair -tls1 -client_auth $CA $extra || exit 1
65 echo test tls1 with both client and server authentication via BIO pair
66 $ssltest -bio_pair -tls1 -server_auth -client_auth $CA $extra || exit 1
68 # note that all the below actually choose TLS...
70 if [ $dsa_cert = NO ]; then
71 echo test sslv2/sslv3 w/o DHE via BIO pair
72 $ssltest -bio_pair -no_dhe $extra || exit 1
75 echo test sslv2/sslv3 with 1024bit DHE via BIO pair
76 $ssltest -bio_pair -dhe1024dsa -v $extra || exit 1
78 echo test sslv2/sslv3 with server authentication
79 $ssltest -bio_pair -server_auth $CA $extra || exit 1
81 echo test sslv2/sslv3 with client authentication via BIO pair
82 $ssltest -bio_pair -client_auth $CA $extra || exit 1
84 echo test sslv2/sslv3 with both client and server authentication via BIO pair
85 $ssltest -bio_pair -server_auth -client_auth $CA $extra || exit 1
87 echo test sslv2/sslv3 with both client and server authentication via BIO pair and app verify
88 $ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1
90 #############################################################################
92 if ../util/shlib_wrap.sh ../apps/openssl no-dh; then
93 echo skipping anonymous DH tests
94 else
95 echo test tls1 with 1024bit anonymous DH, multiple handshakes
96 $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
99 if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
100 echo skipping RSA tests
101 else
102 echo test tls1 with 1024bit RSA, no DHE, multiple handshakes
103 ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1
105 if ../util/shlib_wrap.sh ../apps/openssl no-dh; then
106 echo skipping RSA+DHE tests
107 else
108 echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
109 ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1
113 exit 0