summaryrefslogtreecommitdiff
path: root/src/lib/libssl/test/testssl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/test/testssl')
-rw-r--r--src/lib/libssl/test/testssl120
1 files changed, 88 insertions, 32 deletions
diff --git a/src/lib/libssl/test/testssl b/src/lib/libssl/test/testssl
index a88e290c57..ba5e41c861 100644
--- a/src/lib/libssl/test/testssl
+++ b/src/lib/libssl/test/testssl
@@ -1,81 +1,137 @@
1#!/bin/sh 1#!/bin/sh
2 2
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
13ssltest="./ssltest -key $key -cert $cert -c_key $key -c_cert $cert"
14
15if ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then
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
27if [ "$4" = "" ]; then
28 extra=""
29else
30 extra="$4"
31fi
32
33#############################################################################
34
3echo test sslv2 35echo test sslv2
4./ssltest -ssl2 || exit 1 36$ssltest -ssl2 $extra || exit 1
5 37
6echo test sslv2 with server authentication 38echo test sslv2 with server authentication
7./ssltest -ssl2 -server_auth -CApath ../certs || exit 1 39$ssltest -ssl2 -server_auth $CA $extra || exit 1
8 40
9echo test sslv2 with client authentication 41if [ $dsa_cert = NO ]; then
10./ssltest -ssl2 -client_auth -CApath ../certs || exit 1 42 echo test sslv2 with client authentication
43 $ssltest -ssl2 -client_auth $CA $extra || exit 1
11 44
12echo test sslv2 with both client and server authentication 45 echo test sslv2 with both client and server authentication
13./ssltest -ssl2 -server_auth -client_auth -CApath ../certs || exit 1 46 $ssltest -ssl2 -server_auth -client_auth $CA $extra || exit 1
47fi
14 48
15echo test sslv3 49echo test sslv3
16./ssltest -ssl3 || exit 1 50$ssltest -ssl3 $extra || exit 1
17 51
18echo test sslv3 with server authentication 52echo test sslv3 with server authentication
19./ssltest -ssl3 -server_auth -CApath ../certs || exit 1 53$ssltest -ssl3 -server_auth $CA $extra || exit 1
20 54
21echo test sslv3 with client authentication 55echo test sslv3 with client authentication
22./ssltest -ssl3 -client_auth -CApath ../certs || exit 1 56$ssltest -ssl3 -client_auth $CA $extra || exit 1
23 57
24echo test sslv3 with both client and server authentication 58echo test sslv3 with both client and server authentication
25./ssltest -ssl3 -server_auth -client_auth -CApath ../certs || exit 1 59$ssltest -ssl3 -server_auth -client_auth $CA $extra || exit 1
26 60
27echo test sslv2/sslv3 61echo test sslv2/sslv3
28./ssltest || exit 1 62$ssltest $extra || exit 1
29 63
30echo test sslv2/sslv3 with server authentication 64echo test sslv2/sslv3 with server authentication
31./ssltest -server_auth -CApath ../certs || exit 1 65$ssltest -server_auth $CA $extra || exit 1
32 66
33echo test sslv2/sslv3 with client authentication 67echo test sslv2/sslv3 with client authentication
34./ssltest -client_auth -CApath ../certs || exit 1 68$ssltest -client_auth $CA $extra || exit 1
35 69
36echo test sslv2/sslv3 with both client and server authentication 70echo test sslv2/sslv3 with both client and server authentication
37./ssltest -server_auth -client_auth -CApath ../certs || exit 1 71$ssltest -server_auth -client_auth $CA $extra || exit 1
38 72
39echo test sslv2 via BIO pair 73echo test sslv2 via BIO pair
40./ssltest -bio_pair -ssl2 || exit 1 74$ssltest -bio_pair -ssl2 $extra || exit 1
41 75
42echo test sslv2 with server authentication via BIO pair 76echo test sslv2 with server authentication via BIO pair
43./ssltest -bio_pair -ssl2 -server_auth -CApath ../certs || exit 1 77$ssltest -bio_pair -ssl2 -server_auth $CA $extra || exit 1
44 78
45echo test sslv2 with client authentication via BIO pair 79if [ $dsa_cert = NO ]; then
46./ssltest -bio_pair -ssl2 -client_auth -CApath ../certs || exit 1 80 echo test sslv2 with client authentication via BIO pair
81 $ssltest -bio_pair -ssl2 -client_auth $CA $extra || exit 1
47 82
48echo test sslv2 with both client and server authentication via BIO pair 83 echo test sslv2 with both client and server authentication via BIO pair
49./ssltest -bio_pair -ssl2 -server_auth -client_auth -CApath ../certs || exit 1 84 $ssltest -bio_pair -ssl2 -server_auth -client_auth $CA $extra || exit 1
85fi
50 86
51echo test sslv3 via BIO pair 87echo test sslv3 via BIO pair
52./ssltest -bio_pair -ssl3 || exit 1 88$ssltest -bio_pair -ssl3 $extra || exit 1
53 89
54echo test sslv3 with server authentication via BIO pair 90echo test sslv3 with server authentication via BIO pair
55./ssltest -bio_pair -ssl3 -server_auth -CApath ../certs || exit 1 91$ssltest -bio_pair -ssl3 -server_auth $CA $extra || exit 1
56 92
57echo test sslv3 with client authentication via BIO pair 93echo test sslv3 with client authentication via BIO pair
58./ssltest -bio_pair -ssl3 -client_auth -CApath ../certs || exit 1 94$ssltest -bio_pair -ssl3 -client_auth $CA $extra || exit 1
59 95
60echo test sslv3 with both client and server authentication via BIO pair 96echo test sslv3 with both client and server authentication via BIO pair
61./ssltest -bio_pair -ssl3 -server_auth -client_auth -CApath ../certs || exit 1 97$ssltest -bio_pair -ssl3 -server_auth -client_auth $CA $extra || exit 1
62 98
63echo test sslv2/sslv3 via BIO pair 99echo test sslv2/sslv3 via BIO pair
64./ssltest || exit 1 100$ssltest $extra || exit 1
65 101
66echo test sslv2/sslv3 w/o DHE via BIO pair 102if [ $dsa_cert = NO ]; then
67./ssltest -bio_pair -no_dhe || exit 1 103 echo test sslv2/sslv3 w/o DHE via BIO pair
104 $ssltest -bio_pair -no_dhe $extra || exit 1
105fi
68 106
69echo test sslv2/sslv3 with 1024bit DHE 107echo test sslv2/sslv3 with 1024bit DHE via BIO pair
70./ssltest -bio_pair -dhe1024 -v || exit 1 108$ssltest -bio_pair -dhe1024dsa -v $extra || exit 1
71 109
72echo test sslv2/sslv3 with server authentication 110echo test sslv2/sslv3 with server authentication
73./ssltest -bio_pair -server_auth -CApath ../certs || exit 1 111$ssltest -bio_pair -server_auth $CA $extra || exit 1
74 112
75echo test sslv2/sslv3 with client authentication via BIO pair 113echo test sslv2/sslv3 with client authentication via BIO pair
76./ssltest -bio_pair -client_auth -CApath ../certs || exit 1 114$ssltest -bio_pair -client_auth $CA $extra || exit 1
77 115
78echo test sslv2/sslv3 with both client and server authentication via BIO pair 116echo test sslv2/sslv3 with both client and server authentication via BIO pair
79./ssltest -bio_pair -server_auth -client_auth -CApath ../certs || exit 1 117$ssltest -bio_pair -server_auth -client_auth $CA $extra || exit 1
118
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
122#############################################################################
123
124echo test tls1 with 1024bit anonymous DH, multiple handshakes
125$ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
126
127if ../apps/openssl no-rsa; then
128 echo skipping RSA tests
129else
130 echo test tls1 with 1024bit RSA, no DHE, multiple handshakes
131 ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1
132
133 echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
134 ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1
135fi
80 136
81exit 0 137exit 0