1 # $OpenBSD: ssh-com.sh,v 1.4 2002/07/16 08:58:16 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'
22 # 2.0.10 does not support UserConfigDirectory
23 # 2.3.1 requires a config in $HOME/.ssh2
25 SRC=`dirname ${SCRIPT}`
28 cat << EOF > $OBJ/sshd2_config
30 # Port and ListenAdress are not used.
33 ListenAddress 127.0.0.1
34 UserConfigDirectory ${OBJ}/%U
36 PubKeyAuthentication yes
37 #AllowedAuthentications publickey
38 AuthorizationFile authorization
39 HostKeyFile ${SRC}/dsa_ssh2.prv
40 PublicHostKeyFile ${SRC}/dsa_ssh2.pub
41 RandomSeedFile ${OBJ}/random_seed
49 # create client config
50 sed "s/HostKeyAlias.*/HostKeyAlias ssh2-localhost-with-alias/" \
51 < $OBJ/ssh_config > $OBJ/ssh_config_com
53 # we need a DSA key for
54 rm -f ${OBJ}/dsa ${OBJ}/dsa.pub
55 ${SSHKEYGEN} -q -N '' -t dsa -f ${OBJ}/dsa
57 # setup userdir, try rsa first
58 mkdir -p ${OBJ}/${USER}
59 cp /dev/null ${OBJ}/${USER}/authorization
61 ${SSHKEYGEN} -e -f ${OBJ}/$t.pub > ${OBJ}/${USER}/$t.com
62 echo Key $t.com >> ${OBJ}/${USER}/authorization
63 echo IdentityFile ${OBJ}/$t >> ${OBJ}/ssh_config_com
66 # convert and append DSA hostkey
68 echo -n 'ssh2-localhost-with-alias,127.0.0.1,::1 '
69 ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub
73 for v in ${VERSIONS}; do
74 sshd2=${TEST_COMBASE}/${v}/sshd2
75 if [ ! -x ${sshd2} ]; then
79 PROXY="proxycommand ${sshd2} -qif ${OBJ}/sshd2_config 2> /dev/null"
80 ${SSH} -qF ${OBJ}/ssh_config_com -o "${PROXY}" dummy exit 0
82 fail "ssh connect to sshd2 ${v} failed"
85 ciphers="3des-cbc blowfish-cbc arcfour"
89 ciphers="$ciphers cast128-cbc"
90 macs="$macs hmac-sha1 hmac-sha1-96 hmac-md5-96"
93 ciphers="$ciphers aes128-cbc cast128-cbc"
94 macs="$macs hmac-sha1 hmac-sha1-96 hmac-md5-96"
100 trace "sshd2 ${v} cipher $c mac $m"
101 verbose "test ${tid}: sshd2 ${v} cipher $c mac $m"
102 ${SSH} -c $c -m $m -qF ${OBJ}/ssh_config_com -o "${PROXY}" dummy exit 0
103 if [ $? -ne 0 ]; then
104 fail "ssh connect to sshd2 ${v} with $c/$m failed"
110 rm -rf ${OBJ}/${USER}
111 for i in sshd_config_proxy ssh_config_proxy random_seed \
112 sshd2_config dsa.pub dsa ssh_config_com; do