]> git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/certcrl/testSubjects/trustSettings/makeTrustSettings
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / clxutils / certcrl / testSubjects / trustSettings / makeTrustSettings
1 #! /bin/csh -f
2 #
3 # Build trust settings needed for the test script trustSettings.scr.
4 # The result is placed in userTrustSettings.plist in the build directory.
5 #
6 if ( $#argv != 0 ) then
7 echo "Usage: makeTrustSettings"
8 exit(1)
9 endif
10
11 set BUILD_DIR=$LOCAL_BUILD_DIR
12 set TRUST_SETTINGS=userTrustSettings.plist
13 set TRUST_SETTINGS_PATH=$BUILD_DIR/$TRUST_SETTINGS
14
15 echo Creating empty $TRUST_SETTINGS in build directory...
16 rm -f "$TRUST_SETTINGS_PATH"
17 security add-trusted-cert -o "$TRUST_SETTINGS_PATH" || exit(1)
18
19 set SECTOOL=security
20 set SECCMD="$SECTOOL add-trusted-cert -i $TRUST_SETTINGS_PATH -o $TRUST_SETTINGS_PATH"
21 set cmd="$SECCMD -p ssl debugRoot.cer"
22 echo $cmd
23 $cmd || exit(1)
24
25 # allowedError = CSSMERR_APPLETP_HOSTNAME_MISMATCH
26 set cmd="$SECCMD -p ssl -e -2147408896 -r unspecified localhost.cer "
27 echo $cmd
28 $cmd || exit(1)
29
30 # allowedError = CSSMERR_APPLETP_CS_BAD_CERT_CHAIN_LENGTH
31 set cmd="$SECCMD -p swUpdate -e -2147408849 -r unspecified csLeafShortPath.cer"
32 echo $cmd
33 $cmd || exit(1)
34
35 set cmd="$SECCMD -p swUpdate csRoot.cer"
36 echo $cmd
37 $cmd || exit(1)
38
39 # allowedError = CSSMERR_TP_CERT_REVOKED
40 set cmd="$SECCMD -e -2147409652 -r unspecified crlTestLeaf.cer"
41 echo $cmd
42 $cmd || exit(1)
43
44 set cmd="$SECCMD crlTestRoot.cer"
45 echo $cmd
46 $cmd || exit(1)
47
48 # default root setting for SMIME : Deny
49 set cmd="$SECCMD -D -p smime -r deny"
50 echo $cmd
51 $cmd || exit(1)