intermedSourceTest [plain text]
#! /bin/csh -f
if ( $ echo "Usage: intermedSourceTest directory [q(uiet)] [t(rustSettings)]"
echo A good directory would be ../../../security_certificates/certs/
exit(1)
endif
set BUILD_DIR=$LOCAL_BUILD_DIR
set CERTS_DIR=$argv[1]
set QUIET=0
set TRUST_SETTINGS_ARG=
shift
while ( $ switch ( "$argv[1]" )
case q:
set QUIET = 1
shift
breaksw
case t:
set TRUST_SETTINGS_ARG = -g
shift
breaksw
default:
echo Usage: intermedSourceTest directory
exit(1)
endsw
end
set CERTCRL=$BUILD_DIR/certcrl
set CERTS_FROM_DB=$BUILD_DIR/certsFromDb
foreach targ ($CERTCRL $CERTS_FROM_DB)
if(! -e $targ) then
echo === $targ is missing. Try building clxutil.
exit(1)
endif
end
set SYSTEM_CERTS=/System/Library/Keychains/SystemCACertificates.keychain
echo starting intermedSourceTest
cd $CERTS_DIR
foreach certFile (*)
if ( -f "$certFile" ) then
if($QUIET == 0) then
echo testing $certFile....
endif
$CERTCRL -c "$certFile" -s -a -f -L -n -N -d $SYSTEM_CERTS $TRUST_SETTINGS_ARG
set ERR=$status
if($ERR == 1) then
echo "Note: $certFile is expired"
else
if($ERR != 0) then
echo "++++++++ Verification error on $certFile ($ERR)"
$CERTCRL -c "$certFile" -s -a -f -v -n -N -d $SYSTEM_CERTS $TRUST_SETTINGS_ARG
exit(1)
endif
endif
end
if($QUIET == 0) then
echo "...intermedSourceTest complete"
endif