]> git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/NISCC/TLS_SSL/nisccSslTest
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / clxutils / NISCC / TLS_SSL / nisccSslTest
1 #! /bin/csh -f
2 #
3 # run NISCC "bad certificate" tests.
4 #
5 # For now this assumed that an sslServer task is already running.
6 #
7 if ( $#argv < 1 ) then
8 echo Usage: nisccSslTest port
9 exit(1)
10 endif
11 #
12 set TESTCASES=testcases
13 set SIMPLE_CERT_DIR=$TESTCASES/simple_client
14 set CLIENT_KC=nisccClient
15 set FULL_CLIENT_KC=$HOME/Library/Keychains/$CLIENT_KC
16 set CLIENT_KEY=client_key.der
17 #
18 set cmd="cd $SIMPLE_CERT_DIR"
19 echo $cmd
20 $cmd || exit(1)
21
22 #
23 # Just once - create KC from scratch
24 #
25 set cmd="rm -f $FULL_CLIENT_KC"
26 echo $cmd
27 $cmd || exit(1)
28 set cmd="certtool y k=$FULL_CLIENT_KC p=$CLIENT_KC c"
29 echo $cmd
30 $cmd > /dev/null || exit(1)
31 foreach cert ( * )
32 echo cert $cert...
33 skipThisNisccCert $cert
34 if($status == 1) then
35 echo "=skip="
36 else
37 dbTool $FULL_CLIENT_KC D R
38 dbTool $FULL_CLIENT_KC i c=$cert k=../$CLIENT_KEY || exit(1)
39 nisccSimpleClient localhost $argv[1] $CLIENT_KC || exit(1)
40 endif
41 end
42 echo ===== NISCC SSL Test SUCCESS =====
43