]> git.saurik.com Git - apple/security.git/blame - SecurityTests/clxutils/updateCert
Security-57740.31.2.tar.gz
[apple/security.git] / SecurityTests / clxutils / updateCert
CommitLineData
d8f41ccd
A
1#! /bin/csh -f
2#
3# Test certs; if expired, replace them via ssl PING
4#
5# usage: updateCert sslHost certFileBase cert...
6#
7# tweak this manually for debug
8set VERBOSE=NO
9#
10if ( $#argv < 3 ) then
11 echo "Usage: updateCert sslHost certFileBase cert..."
12 exit(1)
13endif
14set sslHost=$argv[1]
15shift
16set certFileBase=$argv[1]
17shift
18set certArgs="-c $argv[1]"
19shift
20while ( $#argv > 0 )
21 set certArgs="$certArgs -c $argv[1]"
22 shift
23end
24set OUTFILE=$LOCAL_BUILD_DIR/.certVerifyOut
25if($VERBOSE == YES) then
26 echo Testing $certArgs
27endif
28$LOCAL_BUILD_DIR/certcrl $certArgs -s >& $OUTFILE
29grep TP_CERT_EXPIRED $OUTFILE
30if($status == 1) then
31 if($VERBOSE == YES) then
32 echo "These certs look good."
33 endif
34 exit(0)
35endif
36echo "@@@ Warning: replacing certs for $sslHost @@@"
37$LOCAL_BUILD_DIR/sslViewer $sslHost f $certFileBase
38if($status == 1) then
39 echo "@@@ Error obtaining new cert for $sslHost @@@"
40else
41 echo ...certs replaced for $sslHost in `pwd`
42endif