1
# $OpenBSD: ssh-com.sh,v 1.7 2004/02/24 17:06:52 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'
27
# 2.0.10 does not support UserConfigDirectory
28
# 2.3.1 requires a config in $HOME/.ssh2
30
SRC=`dirname ${SCRIPT}`
33
cat << EOF > $OBJ/sshd2_config
35
# Port and ListenAddress are not used.
38
ListenAddress 127.0.0.1
39
UserConfigDirectory ${OBJ}/%U
41
PubKeyAuthentication yes
42
#AllowedAuthentications publickey
43
AuthorizationFile authorization
44
HostKeyFile ${SRC}/dsa_ssh2.prv
45
PublicHostKeyFile ${SRC}/dsa_ssh2.pub
46
RandomSeedFile ${OBJ}/random_seed
54
# create client config
55
sed "s/HostKeyAlias.*/HostKeyAlias ssh2-localhost-with-alias/" \
56
< $OBJ/ssh_config > $OBJ/ssh_config_com
58
# we need a DSA key for
59
rm -f ${OBJ}/dsa ${OBJ}/dsa.pub
60
${SSHKEYGEN} -q -N '' -t dsa -f ${OBJ}/dsa
62
# setup userdir, try rsa first
63
mkdir -p ${OBJ}/${USER}
64
cp /dev/null ${OBJ}/${USER}/authorization
66
${SSHKEYGEN} -e -f ${OBJ}/$t.pub > ${OBJ}/${USER}/$t.com
67
echo Key $t.com >> ${OBJ}/${USER}/authorization
68
echo IdentityFile ${OBJ}/$t >> ${OBJ}/ssh_config_com
71
# convert and append DSA hostkey
73
echon 'ssh2-localhost-with-alias,127.0.0.1,::1 '
74
${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub
78
for v in ${VERSIONS}; do
79
sshd2=${TEST_COMBASE}/${v}/sshd2
80
if [ ! -x ${sshd2} ]; then
84
PROXY="proxycommand ${sshd2} -qif ${OBJ}/sshd2_config 2> /dev/null"
85
${SSH} -qF ${OBJ}/ssh_config_com -o "${PROXY}" dummy exit 0
87
fail "ssh connect to sshd2 ${v} failed"
90
ciphers="3des-cbc blowfish-cbc arcfour"
94
ciphers="$ciphers cast128-cbc"
95
macs="$macs hmac-sha1 hmac-sha1-96 hmac-md5-96"
98
ciphers="$ciphers aes128-cbc cast128-cbc"
99
macs="$macs hmac-sha1 hmac-sha1-96 hmac-md5-96"
104
for c in $ciphers; do
105
trace "sshd2 ${v} cipher $c mac $m"
106
verbose "test ${tid}: sshd2 ${v} cipher $c mac $m"
107
${SSH} -c $c -m $m -qF ${OBJ}/ssh_config_com -o "${PROXY}" dummy exit 0
108
if [ $? -ne 0 ]; then
109
fail "ssh connect to sshd2 ${v} with $c/$m failed"
115
rm -rf ${OBJ}/${USER}
116
for i in sshd_config_proxy ssh_config_proxy random_seed \
117
sshd2_config dsa.pub dsa ssh_config_com; do