]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/testssl
Fix for EXP-RC2-CBC-MD5
[thirdparty/openssl.git] / test / testssl
CommitLineData
d02b48c6
RE
1#!/bin/sh
2
65b002f3
BM
3if [ "$1" = "" ]; then
4 key=../apps/server.pem
5else
6 key="$1"
7fi
8if [ "$2" = "" ]; then
9 cert=../apps/server.pem
10else
11 cert="$2"
12fi
62d27939 13ssltest="../util/shlib_wrap.sh ./ssltest -key $key -cert $cert -c_key $key -c_cert $cert"
65b002f3 14
62d27939 15if ../util/shlib_wrap.sh ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then
65b002f3
BM
16 dsa_cert=YES
17else
18 dsa_cert=NO
19fi
20
21if [ "$3" = "" ]; then
22 CA="-CApath ../certs"
23else
24 CA="-CAfile $3"
25fi
26
23f80f46
RL
27if [ "$4" = "" ]; then
28 extra=""
29else
30 extra="$4"
31fi
32
65b002f3
BM
33#############################################################################
34
d02b48c6 35echo test sslv2
23f80f46 36$ssltest -ssl2 $extra || exit 1
d02b48c6
RE
37
38echo test sslv2 with server authentication
23f80f46 39$ssltest -ssl2 -server_auth $CA $extra || exit 1
d02b48c6 40
65b002f3
BM
41if [ $dsa_cert = NO ]; then
42 echo test sslv2 with client authentication
23f80f46 43 $ssltest -ssl2 -client_auth $CA $extra || exit 1
d02b48c6 44
65b002f3 45 echo test sslv2 with both client and server authentication
23f80f46 46 $ssltest -ssl2 -server_auth -client_auth $CA $extra || exit 1
65b002f3 47fi
d02b48c6
RE
48
49echo test sslv3
23f80f46 50$ssltest -ssl3 $extra || exit 1
d02b48c6
RE
51
52echo test sslv3 with server authentication
23f80f46 53$ssltest -ssl3 -server_auth $CA $extra || exit 1
d02b48c6
RE
54
55echo test sslv3 with client authentication
23f80f46 56$ssltest -ssl3 -client_auth $CA $extra || exit 1
d02b48c6
RE
57
58echo test sslv3 with both client and server authentication
23f80f46 59$ssltest -ssl3 -server_auth -client_auth $CA $extra || exit 1
d02b48c6
RE
60
61echo test sslv2/sslv3
23f80f46 62$ssltest $extra || exit 1
d02b48c6
RE
63
64echo test sslv2/sslv3 with server authentication
23f80f46 65$ssltest -server_auth $CA $extra || exit 1
d02b48c6
RE
66
67echo test sslv2/sslv3 with client authentication
23f80f46 68$ssltest -client_auth $CA $extra || exit 1
d02b48c6
RE
69
70echo test sslv2/sslv3 with both client and server authentication
23f80f46 71$ssltest -server_auth -client_auth $CA $extra || exit 1
d02b48c6 72
95d29597 73echo test sslv2 via BIO pair
23f80f46 74$ssltest -bio_pair -ssl2 $extra || exit 1
95d29597
BM
75
76echo test sslv2 with server authentication via BIO pair
23f80f46 77$ssltest -bio_pair -ssl2 -server_auth $CA $extra || exit 1
95d29597 78
65b002f3
BM
79if [ $dsa_cert = NO ]; then
80 echo test sslv2 with client authentication via BIO pair
23f80f46 81 $ssltest -bio_pair -ssl2 -client_auth $CA $extra || exit 1
95d29597 82
65b002f3 83 echo test sslv2 with both client and server authentication via BIO pair
23f80f46 84 $ssltest -bio_pair -ssl2 -server_auth -client_auth $CA $extra || exit 1
65b002f3 85fi
95d29597
BM
86
87echo test sslv3 via BIO pair
23f80f46 88$ssltest -bio_pair -ssl3 $extra || exit 1
95d29597
BM
89
90echo test sslv3 with server authentication via BIO pair
23f80f46 91$ssltest -bio_pair -ssl3 -server_auth $CA $extra || exit 1
95d29597
BM
92
93echo test sslv3 with client authentication via BIO pair
23f80f46 94$ssltest -bio_pair -ssl3 -client_auth $CA $extra || exit 1
95d29597
BM
95
96echo test sslv3 with both client and server authentication via BIO pair
23f80f46 97$ssltest -bio_pair -ssl3 -server_auth -client_auth $CA $extra || exit 1
d02b48c6 98
95d29597 99echo test sslv2/sslv3 via BIO pair
23f80f46 100$ssltest $extra || exit 1
95d29597 101
65b002f3
BM
102if [ $dsa_cert = NO ]; then
103 echo test sslv2/sslv3 w/o DHE via BIO pair
23f80f46 104 $ssltest -bio_pair -no_dhe $extra || exit 1
65b002f3 105fi
77fa04a9 106
563f1503 107echo test sslv2/sslv3 with 1024bit DHE via BIO pair
23f80f46 108$ssltest -bio_pair -dhe1024dsa -v $extra || exit 1
a87030a1 109
95d29597 110echo test sslv2/sslv3 with server authentication
23f80f46 111$ssltest -bio_pair -server_auth $CA $extra || exit 1
95d29597
BM
112
113echo test sslv2/sslv3 with client authentication via BIO pair
23f80f46 114$ssltest -bio_pair -client_auth $CA $extra || exit 1
95d29597
BM
115
116echo test sslv2/sslv3 with both client and server authentication via BIO pair
23f80f46 117$ssltest -bio_pair -server_auth -client_auth $CA $extra || exit 1
65b002f3 118
023ec151
BM
119echo test sslv2/sslv3 with both client and server authentication via BIO pair and app verify
120$ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1
121
6351adec
AL
122echo "Testing ciphersuites"
123for protocol in SSLv3; do
124 echo "Testing ciphersuites for $protocol"
125 for cipher in `../util/shlib_wrap.sh ../apps/openssl ciphers "RSA+$protocol" | tr ':' ' '`; do
126 echo "Testing $cipher"
127 prot=""
128 if [ $protocol == "SSLv3" ] ; then
129 prot="-ssl3"
130 fi
131 $ssltest -cipher $cipher $prot
132 if [ $? -ne 0 ] ; then
133 echo "Failed $cipher"
134 exit 1
135 fi
136 done
137done
138
65b002f3
BM
139#############################################################################
140
62d27939 141if ../util/shlib_wrap.sh ../apps/openssl no-dh; then
0d3f2ccb
RL
142 echo skipping anonymous DH tests
143else
144 echo test tls1 with 1024bit anonymous DH, multiple handshakes
145 $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
146fi
d58d6c27 147
62d27939 148if ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
46c4647e
BM
149 echo skipping RSA tests
150else
65b002f3 151 echo test tls1 with 1024bit RSA, no DHE, multiple handshakes
62d27939 152 ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1
95d29597 153
62d27939 154 if ../util/shlib_wrap.sh ../apps/openssl no-dh; then
0d3f2ccb
RL
155 echo skipping RSA+DHE tests
156 else
157 echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
62d27939 158 ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1
0d3f2ccb 159 fi
65b002f3 160fi
563f1503 161
95d29597 162exit 0