1 # $OpenBSD: ssh-com.sh,v 1.3 2002/03/15 13:08:56 markus 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'
21 # 2.0.10 does not support UserConfigDirectory
23 SRC=`dirname ${SCRIPT}`
26 cat << EOF > $OBJ/sshd2_config
28 # Port and ListenAdress are not used.
31 ListenAddress 127.0.0.1
32 UserConfigDirectory ${OBJ}/%U
34 PubKeyAuthentication yes
35 #AllowedAuthentications publickey
36 AuthorizationFile authorization
37 HostKeyFile ${SRC}/dsa_ssh2.prv
38 PublicHostKeyFile ${SRC}/dsa_ssh2.pub
39 RandomSeedFile ${OBJ}/random_seed
47 # create client config
48 sed "s/HostKeyAlias.*/HostKeyAlias ssh2-localhost-with-alias/" \
49 < $OBJ/ssh_config > $OBJ/ssh_config_com
51 # we need a DSA key for
52 rm -f ${OBJ}/dsa ${OBJ}/dsa.pub
53 ${SSHKEYGEN} -q -N '' -t dsa -f ${OBJ}/dsa
55 # setup userdir, try rsa first
56 mkdir -p ${OBJ}/${USER}
57 cp /dev/null ${OBJ}/${USER}/authorization
59 ${SSHKEYGEN} -e -f ${OBJ}/$t.pub > ${OBJ}/${USER}/$t.com
60 echo Key $t.com >> ${OBJ}/${USER}/authorization
61 echo IdentityFile ${OBJ}/$t >> ${OBJ}/ssh_config_com
64 # convert and append DSA hostkey
66 echo -n 'ssh2-localhost-with-alias,127.0.0.1,::1 '
67 ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub
71 for v in ${VERSIONS}; do
72 sshd2=${TEST_COMBASE}/${v}/sshd2
73 if [ ! -x ${sshd2} ]; then
77 PROXY="proxycommand ${sshd2} -qif ${OBJ}/sshd2_config 2> /dev/null"
78 ${SSH} -qF ${OBJ}/ssh_config_com -o "${PROXY}" dummy exit 0
80 fail "ssh connect to sshd2 ${v} failed"
83 ciphers="3des-cbc blowfish-cbc arcfour"
87 ciphers="$ciphers cast128-cbc"
88 macs="$macs hmac-sha1 hmac-sha1-96 hmac-md5-96"
91 ciphers="$ciphers aes128-cbc cast128-cbc"
92 macs="$macs hmac-sha1 hmac-sha1-96 hmac-md5-96"
98 trace "sshd2 ${v} cipher $c mac $m"
99 verbose "test ${tid}: sshd2 ${v} cipher $c mac $m"
100 ${SSH} -c $c -m $m -qF ${OBJ}/ssh_config_com -o "${PROXY}" dummy exit 0
101 if [ $? -ne 0 ]; then
102 fail "ssh connect to sshd2 ${v} with $c/$m failed"
108 rm -rf ${OBJ}/${USER}
109 for i in sshd_config_proxy ssh_config_proxy random_seed \
110 sshd2_config dsa.pub dsa ssh_config_com; do