]> git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/sslScripts/sslKcSetup
Security-57031.1.35.tar.gz
[apple/security.git] / SecurityTests / clxutils / sslScripts / sslKcSetup
1 #
2 # common keychain stuff shared by makeLocalCert and ssldvt
3 #
4 set BUILD_DIR=$LOCAL_BUILD_DIR
5 #
6 # generally used by ssl server side
7 set LOCAL_KC=localcert
8 set LOCAL_KC_PWD=localcert
9 set LOCAL_CERT=$BUILD_DIR/$LOCAL_KC.cer
10
11 # ssl client side
12 set CLIENT_KC=clientcert
13 set CLIENT_KC_PWD=clientcert
14 set CLIENT_CERT=$BUILD_DIR/$CLIENT_KC.cer
15
16 # one for DSA as well
17 set DSA_KC=dsacert
18 set DSA_KC_PWD=dsacert
19 set DSA_CERT=$BUILD_DIR/$DSA_KC.cer
20
21 # import P12_PFX to P12_KC
22 set P12_PFX=test1.p12
23 set P12_KC=p12cert
24
25 # passwords for P12_PFX, P12_KC
26 set P12_PFX_PWD=password
27 set P12_KC_PWD=p12cert
28 # extract from P12_KC to this file base
29 set P12_CERT_BASE=$BUILD_DIR/p12cert
30 # and this one is the root
31 set P12_ROOT_CERT=$BUILD_DIR/p12cert_1
32
33 #
34 # keychain directory, which varies depending on whether we are root.
35 # Note since root behaves differently depending on whether we actually logged in
36 # as root, or is running via e.g. cron, we force the issue of "where are root's
37 # keychains kept" by specifying a full path for the keychain for root in any case.
38 #
39 set USERNAME=`whoami`
40 if($USERNAME == root) then
41 set KC_DIR=$BUILD_DIR/Library/Keychains
42 else
43 set KC_DIR=$HOME/Library/Keychains
44 endif
45
46 # full paths for when we refer to actual files
47 set LOCAL_KC_PATH=$KC_DIR/$LOCAL_KC
48 set CLIENT_KC_PATH=$KC_DIR/$CLIENT_KC
49 set DSA_KC_PATH=$KC_DIR/$DSA_KC
50 set P12_KC_PATH=$KC_DIR/$P12_KC
51
52 # and re-set keychain names for root only
53 if($USERNAME == root) then
54 mkdir -p $KC_DIR
55 set LOCAL_KC=$LOCAL_KC_PATH
56 set CLIENT_KC=$CLIENT_KC_PATH
57 set DSA_KC=$DSA_KC_PATH
58 set P12_KC=$P12_KC_PATH
59 endif