]> git.saurik.com Git - apple/security.git/blame - SecurityTests/clxutils/sslScripts/authClient
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / clxutils / sslScripts / authClient
CommitLineData
d8f41ccd
A
1#! /bin/csh -f
2#
3# run client side of SSL client certificate test. Run this script
4# after starting authServe script.
5#
6# In SSL_AUTO mode, we wait SSL_WAIT seconds between runs of sslServer from
7# the protServe script to allow the sslServer to get initialized.
8# Otherwise we wait manually via the sh script doprompt.
9#
10set SSL_KEYCHAIN=localcert
11set SSL_NEWROOT=localcert.cer
12#
13# set allow hostname spoof for use with numeric IP address (e.g., 10.0.61.6)
14# if the server cert doesn't have a subjectAltName.
15#
16#set NAME_SPOOF=H
17set NAME_SPOOF=
18
19set SSL_HOST=localhost
20
21set SSL_AUTO=0
22set QUIET=
23while ( $#argv > 0 )
24 switch ( "$argv[1]" )
25 case a:
26 set SSL_AUTO = 1
27 shift
28 breaksw
29 case q:
30 set QUIET = q
31 shift
32 breaksw
33 default:
34 echo 'Usage: protClient [a(auto)]'
35 exit(1)
36 endsw
37end
38#
39# options for every run of sslViewer
40#
41set STD_OPTS="$SSL_HOST a $SSL_NEWROOT $NAME_SPOOF"
42
43echo ===== Server tries authentication, client refuses
44
45runProtClient $QUIET $STD_OPTS P=1200 t T=r || exit(1)
46doprompt $SSL_AUTO $QUIET
47
48echo ===== Server tries authentication, client sends cert
49
50runProtClient $QUIET $STD_OPTS P=1201 k=$SSL_KEYCHAIN t T=s || exit(1)
51doprompt $SSL_AUTO $QUIET
52
53echo ===== Server requires authentication, client refuses, expect error
54
55runProtClient $QUIET e "Expect error due to auth requirement" \
56 $STD_OPTS P=1202 t T=r || exit(1)
57doprompt $SSL_AUTO $QUIET
58
59echo ===== Server requires authentication, client refuses, SSL3, expect error
60
61runProtClient $QUIET e "Expect error due to auth requirement" \
62 $STD_OPTS P=1203 3 T=r || exit(1)
63doprompt $SSL_AUTO $QUIET
64
65echo ===== Server requires authentication, client sends cert
66
67runProtClient $QUIET $STD_OPTS P=1204 k=$SSL_KEYCHAIN t T=s || exit(1)
68doprompt $SSL_AUTO $QUIET
69
70echo =====
71echo ===== authClient success
72echo =====