1 # $OpenBSD: ssh-com.sh,v 1.6 2003/11/07 10:16:44 jmc Exp $
2 # Placed in the Public Domain.
4 tid="connect to ssh.com server"
6 #TEST_COMBASE=/path/to/ssh/com/binaries
7 if [ "X${TEST_COMBASE}" = "X" ]; then
8 fatal '$TEST_COMBASE is not set'
24 # 2.0.10 does not support UserConfigDirectory
25 # 2.3.1 requires a config in $HOME/.ssh2
27 SRC=`dirname ${SCRIPT}`
30 cat << EOF > $OBJ/sshd2_config
32 # Port and ListenAddress are not used.
35 ListenAddress 127.0.0.1
36 UserConfigDirectory ${OBJ}/%U
38 PubKeyAuthentication yes
39 #AllowedAuthentications publickey
40 AuthorizationFile authorization
41 HostKeyFile ${SRC}/dsa_ssh2.prv
42 PublicHostKeyFile ${SRC}/dsa_ssh2.pub
43 RandomSeedFile ${OBJ}/random_seed
51 # create client config
52 sed "s/HostKeyAlias.*/HostKeyAlias ssh2-localhost-with-alias/" \
53 < $OBJ/ssh_config > $OBJ/ssh_config_com
55 # we need a DSA key for
56 rm -f ${OBJ}/dsa ${OBJ}/dsa.pub
57 ${SSHKEYGEN} -q -N '' -t dsa -f ${OBJ}/dsa
59 # setup userdir, try rsa first
60 mkdir -p ${OBJ}/${USER}
61 cp /dev/null ${OBJ}/${USER}/authorization
63 ${SSHKEYGEN} -e -f ${OBJ}/$t.pub > ${OBJ}/${USER}/$t.com
64 echo Key $t.com >> ${OBJ}/${USER}/authorization
65 echo IdentityFile ${OBJ}/$t >> ${OBJ}/ssh_config_com
68 # convert and append DSA hostkey
70 echon 'ssh2-localhost-with-alias,127.0.0.1,::1 '
71 ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub
75 for v in ${VERSIONS}; do
76 sshd2=${TEST_COMBASE}/${v}/sshd2
77 if [ ! -x ${sshd2} ]; then
81 PROXY="proxycommand ${sshd2} -qif ${OBJ}/sshd2_config 2> /dev/null"
82 ${SSH} -qF ${OBJ}/ssh_config_com -o "${PROXY}" dummy exit 0
84 fail "ssh connect to sshd2 ${v} failed"
87 ciphers="3des-cbc blowfish-cbc arcfour"
91 ciphers="$ciphers cast128-cbc"
92 macs="$macs hmac-sha1 hmac-sha1-96 hmac-md5-96"
95 ciphers="$ciphers aes128-cbc cast128-cbc"
96 macs="$macs hmac-sha1 hmac-sha1-96 hmac-md5-96"
101 for c in $ciphers; do
102 trace "sshd2 ${v} cipher $c mac $m"
103 verbose "test ${tid}: sshd2 ${v} cipher $c mac $m"
104 ${SSH} -c $c -m $m -qF ${OBJ}/ssh_config_com -o "${PROXY}" dummy exit 0
105 if [ $? -ne 0 ]; then
106 fail "ssh connect to sshd2 ${v} with $c/$m failed"
112 rm -rf ${OBJ}/${USER}
113 for i in sshd_config_proxy ssh_config_proxy random_seed \
114 sshd2_config dsa.pub dsa ssh_config_com; do