]>
git.saurik.com Git - apple/security.git/blob - SecurityTests/clxutils/importExport/importExportOpenssh
3 # Run OpenSSH import/export tests.
5 # Run this from SecurityTests/clxutils/importExport. This
6 # uses the importExportOpensshTool subtool to do most of its work.
9 echo === Begin OpenSSH
test ===
13 set SSHSUBTOOL
=.
/importExportOpensshTool
16 # this is the wrap/unwrap password; it has to match the password in
17 # the importExportOpensshTool tool
21 # file names generated by ssh-keygen
22 set SSH_KEY_NAME
=sshkeygenKey
23 set PRIV_KEY
=${LOCAL_BUILD_DIR}/$SSH_KEY_NAME
24 set PUB_KEY
=${LOCAL_BUILD_DIR}/${SSH_KEY_NAME}.pub
26 set SSH_KEYGEN
=/usr
/bin
/ssh-keygen
28 # determine whether to attempt ssh1 key generation and import
29 # %%%FIXME this is currently disabled since OpenSSH 5.4 does not support it by default
32 # determine whether to attempt ssh2 key generation and import
33 # %%%FIXME this is currently disabled due to <rdar://problem/8063663>
36 # user specified variables
62 echo Usage
: importExportOpenssh \
[q\
(uiet\
)\
] \
[n\
(oACL\
)\
] \
[s\
(ecurePassphrase\
)\
] \
[N\
(oClean\
)\
]
67 # delete existing keys - ssh-keygen is cautious about overwriting
68 set cmd
="rm -f $PRIV_KEY $PUB_KEY"
69 if ($QUIET == NO
) then
74 if ($TESTSSH1 != NO
) then
76 # RSA, SSH1, wrapped private key
78 set cmd
="$SSH_KEYGEN -b $KEYSIZE -C someOldComment -N $PASSWORD -f $PRIV_KEY -t rsa1 -q"
79 if ($QUIET == NO
) then
83 set cmd
="$SSHSUBTOOL $PRIV_KEY ssh1Wrap $PUB_KEY ssh1 rsa $QUIET $NOACL $SECURE_PHRASE $NOCLEAN"
84 if ($QUIET == NO
) then
89 # delete existing keys
90 set cmd
="rm -f $PRIV_KEY $PUB_KEY"
91 if ($QUIET == NO
) then
97 # RSA, SSH1, cleartext private key
99 set cmd
="$SSH_KEYGEN -b $KEYSIZE -C someOldComment -f $PRIV_KEY -t rsa1 -q -N"
100 if ($QUIET == NO
) then
103 # note the shell hack we're using to insert an empty argument for the null password
105 set cmd
="$SSHSUBTOOL $PRIV_KEY ssh1 $PUB_KEY ssh1 rsa $QUIET $NOACL $SECURE_PHRASE $NOCLEAN"
106 if ($QUIET == NO
) then
111 # delete existing keys
112 set cmd
="rm -f $PRIV_KEY $PUB_KEY"
113 if ($QUIET == NO
) then
119 echo "WARNING: OpenSSH ssh1 key import tests are DISABLED (<rdar://8063663>)"
122 if ($TESTSSH2 != NO
) then
124 # RSA, SSH2, wrapped private key
126 set cmd
="$SSH_KEYGEN -b $KEYSIZE -C someOldComment -N $PASSWORD -f $PRIV_KEY -t rsa -q"
127 if ($QUIET == NO
) then
131 set cmd
="$SSHSUBTOOL $PRIV_KEY ssh2Wrap $PUB_KEY ssh2 rsa $QUIET $NOACL $SECURE_PHRASE $NOCLEAN"
132 if ($QUIET == NO
) then
137 # delete existing keys
138 set cmd
="rm -f $PRIV_KEY $PUB_KEY"
139 if ($QUIET == NO
) then
145 # RSA, SSH2, cleartext private key
147 set cmd
="$SSH_KEYGEN -b $KEYSIZE -C someOldComment -f $PRIV_KEY -t rsa -q -N"
148 if ($QUIET == NO
) then
151 # note the shell hack we're using to insert an empty argument for the null password
153 set cmd
="$SSHSUBTOOL $PRIV_KEY ssh2 $PUB_KEY ssh2 rsa $QUIET $NOACL $SECURE_PHRASE $NOCLEAN"
154 if ($QUIET == NO
) then
159 # delete existing keys
160 set cmd
="rm -f $PRIV_KEY $PUB_KEY"
161 if ($QUIET == NO
) then
167 # DSA, SSH2, wrapped private key
169 set cmd
="$SSH_KEYGEN -b $KEYSIZE -C someOldComment -N $PASSWORD -f $PRIV_KEY -t dsa -q"
170 if ($QUIET == NO
) then
174 set cmd
="$SSHSUBTOOL $PRIV_KEY ssh2Wrap $PUB_KEY ssh2 dsa $QUIET $NOACL $SECURE_PHRASE $NOCLEAN"
175 if ($QUIET == NO
) then
180 # delete existing keys
181 set cmd
="rm -f $PRIV_KEY $PUB_KEY"
182 if ($QUIET == NO
) then
188 # DSA, SSH2, cleartext private key
190 set cmd
="$SSH_KEYGEN -b $KEYSIZE -C someOldComment -f $PRIV_KEY -t dsa -q -N"
191 if ($QUIET == NO
) then
194 # note the shell hack we're using to insert an empty argument for the null password
196 set cmd
="$SSHSUBTOOL $PRIV_KEY ssh2 $PUB_KEY ssh2 dsa $QUIET $NOACL $SECURE_PHRASE $NOCLEAN"
197 if ($QUIET == NO
) then
203 echo "WARNING: OpenSSH ssh2 key import tests are DISABLED (<rdar://8063663>)"
209 if($NOCLEAN == NO
) then
210 set cmd
="rm -f $PRIV_KEY $PUB_KEY"
211 if ($QUIET == NO
) then
217 if ($QUIET == NO
) then
218 echo === OpenSSH
test complete
===