96
101
if [ "x$TEST_SSH_SCP" != "x" ]; then
97
102
SCP="${TEST_SSH_SCP}"
104
if [ "x$TEST_SSH_PLINK" != "x" ]; then
105
# Find real binary, if it exists
106
case "${TEST_SSH_PLINK}" in
107
/*) PLINK="${TEST_SSH_PLINK}" ;;
108
*) PLINK=`which ${TEST_SSH_PLINK} 2>/dev/null` ;;
111
if [ "x$TEST_SSH_PUTTYGEN" != "x" ]; then
112
# Find real binary, if it exists
113
case "${TEST_SSH_PUTTYGEN}" in
114
/*) PUTTYGEN="${TEST_SSH_PUTTYGEN}" ;;
115
*) PUTTYGEN=`which ${TEST_SSH_PUTTYGEN} 2>/dev/null` ;;
118
if [ "x$TEST_SSH_CONCH" != "x" ]; then
119
# Find real binary, if it exists
120
case "${TEST_SSH_CONCH}" in
121
/*) CONCH="${TEST_SSH_CONCH}" ;;
122
*) CONCH=`which ${TEST_SSH_CONCH} 2>/dev/null` ;;
100
126
# Path to sshd must be absolute for rexec
270
296
chmod 644 $OBJ/authorized_keys_$USER
298
# Activate Twisted Conch tests if the binary is present
299
REGRESS_INTEROP_CONCH=no
300
if test -x "$CONCH" ; then
301
REGRESS_INTEROP_CONCH=yes
304
# If PuTTY is present and we are running a PuTTY test, prepare keys and
306
REGRESS_INTEROP_PUTTY=no
307
if test -x "$PUTTYGEN" -a -x "$PLINK" ; then
308
REGRESS_INTEROP_PUTTY=yes
312
*) REGRESS_INTEROP_PUTTY=no ;;
315
if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then
316
mkdir -p ${OBJ}/.putty
318
# Add a PuTTY key to authorized_keys
319
rm -f ${OBJ}/putty.rsa2
320
puttygen -t rsa -o ${OBJ}/putty.rsa2 < /dev/null > /dev/null
321
puttygen -O public-openssh ${OBJ}/putty.rsa2 \
322
>> $OBJ/authorized_keys_$USER
324
# Convert rsa2 host key to PuTTY format
325
${SRC}/ssh2putty.sh 127.0.0.1 $PORT $OBJ/rsa > \
326
${OBJ}/.putty/sshhostkeys
327
${SRC}/ssh2putty.sh 127.0.0.1 22 $OBJ/rsa >> \
328
${OBJ}/.putty/sshhostkeys
330
# Setup proxied session
331
mkdir -p ${OBJ}/.putty/sessions
332
rm -f ${OBJ}/.putty/sessions/localhost_proxy
333
echo "Hostname=127.0.0.1" >> ${OBJ}/.putty/sessions/localhost_proxy
334
echo "PortNumber=$PORT" >> ${OBJ}/.putty/sessions/localhost_proxy
335
echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy
336
echo "ProxyTelnetCommand=sh ${SRC}/sshd-log-wrapper.sh ${SSHD} ${TEST_SSH_LOGFILE} -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy
338
REGRESS_INTEROP_PUTTY=yes
272
341
# create a proxy version of the client config
274
343
cat $OBJ/ssh_config
284
$SUDO ${SSHD} -f $OBJ/sshd_config -t || fatal "sshd_config broken"
285
$SUDO ${SSHD} -f $OBJ/sshd_config -e >>$TEST_SSH_LOGFILE 2>&1
353
$SUDO ${SSHD} -f $OBJ/sshd_config "$@" -t || fatal "sshd_config broken"
354
$SUDO ${SSHD} -f $OBJ/sshd_config -e "$@" >>$TEST_SSH_LOGFILE 2>&1
287
356
trace "wait for sshd"