xref: /minix3/crypto/external/bsd/openssl/dist/test/testfipsssl (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc#!/bin/sh
2*ebfedea0SLionel Sambuc
3*ebfedea0SLionel Sambucif [ "$1" = "" ]; then
4*ebfedea0SLionel Sambuc  key=../apps/server.pem
5*ebfedea0SLionel Sambucelse
6*ebfedea0SLionel Sambuc  key="$1"
7*ebfedea0SLionel Sambucfi
8*ebfedea0SLionel Sambucif [ "$2" = "" ]; then
9*ebfedea0SLionel Sambuc  cert=../apps/server.pem
10*ebfedea0SLionel Sambucelse
11*ebfedea0SLionel Sambuc  cert="$2"
12*ebfedea0SLionel Sambucfi
13*ebfedea0SLionel Sambuc
14*ebfedea0SLionel Sambucciphers="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"
15*ebfedea0SLionel Sambuc
16*ebfedea0SLionel Sambucssltest="../util/shlib_wrap.sh ./ssltest -F -key $key -cert $cert -c_key $key -c_cert $cert -cipher $ciphers"
17*ebfedea0SLionel Sambuc
18*ebfedea0SLionel Sambucif ../util/shlib_wrap.sh ../apps/openssl x509 -in $cert -text -noout | fgrep 'DSA Public Key' >/dev/null; then
19*ebfedea0SLionel Sambuc  dsa_cert=YES
20*ebfedea0SLionel Sambucelse
21*ebfedea0SLionel Sambuc  dsa_cert=NO
22*ebfedea0SLionel Sambucfi
23*ebfedea0SLionel Sambuc
24*ebfedea0SLionel Sambucif [ "$3" = "" ]; then
25*ebfedea0SLionel Sambuc  CA="-CApath ../certs"
26*ebfedea0SLionel Sambucelse
27*ebfedea0SLionel Sambuc  CA="-CAfile $3"
28*ebfedea0SLionel Sambucfi
29*ebfedea0SLionel Sambuc
30*ebfedea0SLionel Sambucif [ "$4" = "" ]; then
31*ebfedea0SLionel Sambuc  extra=""
32*ebfedea0SLionel Sambucelse
33*ebfedea0SLionel Sambuc  extra="$4"
34*ebfedea0SLionel Sambucfi
35*ebfedea0SLionel Sambuc
36*ebfedea0SLionel Sambuc#############################################################################
37*ebfedea0SLionel Sambuc
38*ebfedea0SLionel Sambucecho test ssl3 is forbidden in FIPS mode
39*ebfedea0SLionel Sambuc$ssltest -ssl3 $extra && exit 1
40*ebfedea0SLionel Sambuc
41*ebfedea0SLionel Sambucecho test ssl2 is forbidden in FIPS mode
42*ebfedea0SLionel Sambuc$ssltest -ssl2 $extra && exit 1
43*ebfedea0SLionel Sambuc
44*ebfedea0SLionel Sambucecho test tls1
45*ebfedea0SLionel Sambuc$ssltest -tls1 $extra || exit 1
46*ebfedea0SLionel Sambuc
47*ebfedea0SLionel Sambucecho test tls1 with server authentication
48*ebfedea0SLionel Sambuc$ssltest -tls1 -server_auth $CA $extra || exit 1
49*ebfedea0SLionel Sambuc
50*ebfedea0SLionel Sambucecho test tls1 with client authentication
51*ebfedea0SLionel Sambuc$ssltest -tls1 -client_auth $CA $extra || exit 1
52*ebfedea0SLionel Sambuc
53*ebfedea0SLionel Sambucecho test tls1 with both client and server authentication
54*ebfedea0SLionel Sambuc$ssltest -tls1 -server_auth -client_auth $CA $extra || exit 1
55*ebfedea0SLionel Sambuc
56*ebfedea0SLionel Sambucecho test tls1 via BIO pair
57*ebfedea0SLionel Sambuc$ssltest -bio_pair -tls1 $extra || exit 1
58*ebfedea0SLionel Sambuc
59*ebfedea0SLionel Sambucecho test tls1 with server authentication via BIO pair
60*ebfedea0SLionel Sambuc$ssltest -bio_pair -tls1 -server_auth $CA $extra || exit 1
61*ebfedea0SLionel Sambuc
62*ebfedea0SLionel Sambucecho test tls1 with client authentication via BIO pair
63*ebfedea0SLionel Sambuc$ssltest -bio_pair -tls1 -client_auth $CA $extra || exit 1
64*ebfedea0SLionel Sambuc
65*ebfedea0SLionel Sambucecho test tls1 with both client and server authentication via BIO pair
66*ebfedea0SLionel Sambuc$ssltest -bio_pair -tls1 -server_auth -client_auth $CA $extra || exit 1
67*ebfedea0SLionel Sambuc
68*ebfedea0SLionel Sambuc# note that all the below actually choose TLS...
69*ebfedea0SLionel Sambuc
70*ebfedea0SLionel Sambucif [ $dsa_cert = NO ]; then
71*ebfedea0SLionel Sambuc  echo test sslv2/sslv3 w/o DHE via BIO pair
72*ebfedea0SLionel Sambuc  $ssltest -bio_pair -no_dhe $extra || exit 1
73*ebfedea0SLionel Sambucfi
74*ebfedea0SLionel Sambuc
75*ebfedea0SLionel Sambucecho test sslv2/sslv3 with 1024bit DHE via BIO pair
76*ebfedea0SLionel Sambuc$ssltest -bio_pair -dhe1024dsa -v $extra || exit 1
77*ebfedea0SLionel Sambuc
78*ebfedea0SLionel Sambucecho test sslv2/sslv3 with server authentication
79*ebfedea0SLionel Sambuc$ssltest -bio_pair -server_auth $CA $extra || exit 1
80*ebfedea0SLionel Sambuc
81*ebfedea0SLionel Sambucecho test sslv2/sslv3 with client authentication via BIO pair
82*ebfedea0SLionel Sambuc$ssltest -bio_pair -client_auth $CA $extra || exit 1
83*ebfedea0SLionel Sambuc
84*ebfedea0SLionel Sambucecho test sslv2/sslv3 with both client and server authentication via BIO pair
85*ebfedea0SLionel Sambuc$ssltest -bio_pair -server_auth -client_auth $CA $extra || exit 1
86*ebfedea0SLionel Sambuc
87*ebfedea0SLionel Sambucecho test sslv2/sslv3 with both client and server authentication via BIO pair and app verify
88*ebfedea0SLionel Sambuc$ssltest -bio_pair -server_auth -client_auth -app_verify $CA $extra || exit 1
89*ebfedea0SLionel Sambuc
90*ebfedea0SLionel Sambuc#############################################################################
91*ebfedea0SLionel Sambuc
92*ebfedea0SLionel Sambucif ../util/shlib_wrap.sh ../apps/openssl no-dh; then
93*ebfedea0SLionel Sambuc  echo skipping anonymous DH tests
94*ebfedea0SLionel Sambucelse
95*ebfedea0SLionel Sambuc  echo test tls1 with 1024bit anonymous DH, multiple handshakes
96*ebfedea0SLionel Sambuc  $ssltest -v -bio_pair -tls1 -cipher ADH -dhe1024dsa -num 10 -f -time $extra || exit 1
97*ebfedea0SLionel Sambucfi
98*ebfedea0SLionel Sambuc
99*ebfedea0SLionel Sambucif ../util/shlib_wrap.sh ../apps/openssl no-rsa; then
100*ebfedea0SLionel Sambuc  echo skipping RSA tests
101*ebfedea0SLionel Sambucelse
102*ebfedea0SLionel Sambuc  echo test tls1 with 1024bit RSA, no DHE, multiple handshakes
103*ebfedea0SLionel Sambuc  ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -no_dhe -num 10 -f -time $extra || exit 1
104*ebfedea0SLionel Sambuc
105*ebfedea0SLionel Sambuc  if ../util/shlib_wrap.sh ../apps/openssl no-dh; then
106*ebfedea0SLionel Sambuc    echo skipping RSA+DHE tests
107*ebfedea0SLionel Sambuc  else
108*ebfedea0SLionel Sambuc    echo test tls1 with 1024bit RSA, 1024bit DHE, multiple handshakes
109*ebfedea0SLionel Sambuc    ../util/shlib_wrap.sh ./ssltest -v -bio_pair -tls1 -cert ../apps/server2.pem -dhe1024dsa -num 10 -f -time $extra || exit 1
110*ebfedea0SLionel Sambuc  fi
111*ebfedea0SLionel Sambucfi
112*ebfedea0SLionel Sambuc
113*ebfedea0SLionel Sambucexit 0
114