]> git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/sslScripts/authExtern
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / clxutils / sslScripts / authExtern
1 #! /bin/csh -f
2 #
3 # run client-side authenticaiton tests on external servers. These
4 # servers will undoubtedly change their behavior some day.
5 #
6 #
7 set TEST_HOST=www.cynic.org
8 set TEST_PATH=//admin/status
9 set SSL_KEYCHAIN=newcert
10 #
11 # use this to explicitly open the keychain
12 #
13 # not yet
14 set KEYCHAIN_PWD=
15 #set KEYCHAIN_PWD="z=newcert"
16
17 echo =====
18 echo ===== $TEST_HOST/$TEST_PATH requires authentication
19 echo ===== Try without cert, expect fail
20 set cmd="sslViewer $TEST_HOST $TEST_PATH a cynicRoot.cer t T=r"
21 echo $cmd
22 $cmd
23 if($status != 1) then
24 echo @@@@@@ expected one error from sslViewer, got $status, aborting.
25 exit(1)
26 endif
27 #
28 echo ===== Try with our bogus cert, expect fail
29 set cmd="sslViewer $TEST_HOST $TEST_PATH a cynicRoot.cer t k=$SSL_KEYCHAIN $KEYCHAIN_PWD T=s"
30 echo $cmd
31 $cmd
32 if($status != 1) then
33 echo @@@@@@ expected one error from sslViewer, got $status, aborting.
34 exit(1)
35 endif
36 #
37 echo =====
38 echo ===== $TEST_HOST/ allows but does not require authentication
39 echo ===== Try without cert, expect success
40 set cmd="sslViewer $TEST_HOST a cynicRoot.cer t T=r"
41 echo $cmd
42 $cmd || exit(1)
43 echo ===== Try with our bogus cert, expect fail
44 set cmd="sslViewer $TEST_HOST $TEST_PATH a cynicRoot.cer k=$SSL_KEYCHAIN $KEYCHAIN_PWD t T=s"
45 echo $cmd
46 $cmd
47 if($status != 1) then
48 echo @@@@@@ expected one error from sslViewer, got $status, aborting.
49 exit(1)
50 endif
51 #
52 set TEST_HOST=doncio.net
53 set TEST_PATH=/secure/DoD_soft_cert
54 echo =====
55 echo ===== $TEST_HOST/$TEST_PATH requests authentication
56 set cmd="sslViewer $TEST_HOST $TEST_PATH 3 r T=r"
57 echo $cmd
58 $cmd || exit(1)
59 set cmd="sslViewer $TEST_HOST $TEST_PATH t r T=r"
60 echo $cmd
61 $cmd || exit(1)
62 echo ===== Try with our bogus cert, expect fail
63 set cmd="sslViewer $TEST_HOST $TEST_PATH k=$SSL_KEYCHAIN $KEYCHAIN_PWD t r T=s"
64 echo $cmd
65 $cmd
66 if($status != 1) then
67 echo @@@@@@ expected one error from sslViewer, got $status, aborting.
68 exit(1)
69 endif
70 set cmd="sslViewer $TEST_HOST $TEST_PATH k=$SSL_KEYCHAIN $KEYCHAIN_PWD 3 r T=s"
71 echo $cmd
72 $cmd
73 if($status != 1) then
74 echo @@@@@@ expected one error from sslViewer, got $status, aborting.
75 exit(1)
76 endif
77
78 echo =====
79 echo ===== authExtern success
80 echo =====