xref: /freebsd/crypto/openssh/regress/proxy-connect.sh (revision a70cba95822f662d3f9da5119b6a0c433e8f70af)
1#	$OpenBSD: proxy-connect.sh,v 1.8 2015/03/03 22:35:19 markus 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	fi
23    done
24  done
25done
26
27for p in ${SSH_PROTOCOLS}; do
28	verbose "username with style protocol $p"
29	${SSH} -$p -F $OBJ/ssh_proxy ${USER}:style@999.999.999.999 true || \
30		fail "ssh proxyconnect protocol $p failed"
31done
32