xref: /freebsd/crypto/openssh/regress/proxy-connect.sh (revision 86c9d9918f1db7cdd968b60f8902466887bcd9e9)
1#	$OpenBSD: proxy-connect.sh,v 1.9 2016/02/17 02:24:17 djm Exp $
2#	Placed in the Public Domain.
3
4tid="proxy connect"
5
6mv $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
7
8for ps in no yes; do
9  cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
10  echo "UsePrivilegeSeparation $ps" >> $OBJ/sshd_proxy
11
12  for p in ${SSH_PROTOCOLS}; do
13    for c in no yes; do
14	verbose "plain username protocol $p privsep=$ps comp=$c"
15	opts="-$p -oCompression=$c -F $OBJ/ssh_proxy"
16	SSH_CONNECTION=`${SSH} $opts 999.999.999.999 'echo $SSH_CONNECTION'`
17	if [ $? -ne 0 ]; then
18		fail "ssh proxyconnect protocol $p privsep=$ps comp=$c failed"
19	fi
20	if [ "$SSH_CONNECTION" != "UNKNOWN 65535 UNKNOWN 65535" ]; then
21		fail "bad SSH_CONNECTION protocol $p privsep=$ps comp=$c: " \
22		    "$SSH_CONNECTION"
23	fi
24    done
25  done
26done
27
28for p in ${SSH_PROTOCOLS}; do
29	verbose "username with style protocol $p"
30	${SSH} -$p -F $OBJ/ssh_proxy ${USER}:style@999.999.999.999 true || \
31		fail "ssh proxyconnect protocol $p failed"
32done
33