Skip to content

Commit b7dc1d9

Browse files
committed
upstream: Add test for ssh -Oconninfo mux command.
OpenBSD-Regress-ID: e939edc41caad8b6ad00ff294f33b61ed32a1edd
1 parent eb97fc2 commit b7dc1d9

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

regress/multiplex.sh

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# $OpenBSD: multiplex.sh,v 1.37 2024/07/19 04:33:36 djm Exp $
1+
# $OpenBSD: multiplex.sh,v 1.38 2025/12/05 06:55:22 dtucker Exp $
22
# Placed in the Public Domain.
33

4-
make_tmpdir
54
CTL=${SSH_REGRESS_TMP}/ctl-sock
65

76
tid="connection multiplexing"
87

98
trace "will use ProxyCommand $proxycmd"
9+
make_tmpdir
1010
if config_defined DISABLE_FD_PASSING ; then
1111
skip "not supported on this platform (FD passing disabled)"
1212
fi
@@ -24,6 +24,7 @@ wait_for_mux_master_ready()
2424
}
2525

2626
maybe_add_scp_path_to_sshd
27+
enable_all_kexes_in_sshd
2728
start_sshd
2829

2930
start_mux_master()
@@ -180,6 +181,13 @@ N=$(echo "xyzzy" | $NC -U $OBJ/unix-1.fwd 2>&1 | grep "xyzzy" | wc -l)
180181
test ${N} -eq 0 || fail "remote forward path still listening"
181182
rm -f $OBJ/unix-1.fwd
182183

184+
verbose "test $tid: cmd conninfo"
185+
conninfo=`${SSH} -F $OBJ/ssh_config -S $CTL -Oconninfo otherhost` \
186+
|| fail "request remote forward failed"
187+
if echo "$conninfo" | ! egrep -- "-> 127.0.0.1:$port" >/dev/null; then
188+
fail "conninfo"
189+
fi
190+
183191
verbose "test $tid: cmd exit"
184192
${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
185193
|| fail "send exit command failed"
@@ -188,11 +196,28 @@ ${SSH} -F $OBJ/ssh_config -S $CTL -Oexit otherhost >>$TEST_REGRESS_LOGFILE 2>&1
188196
wait $SSH_PID
189197
kill -0 $SSH_PID >/dev/null 2>&1 && fail "exit command failed"
190198

199+
# Enable compression and alternative kex for next conninfo test.
200+
if $SSH -Q compression | grep zlib@openssh.com >/dev/null; then
201+
echo compression yes >>$OBJ/ssh_config
202+
echo kexalgorithms curve25519-sha256 >>$OBJ/ssh_config
203+
echo ciphers aes128-ctr >>$OBJ/ssh_config
204+
fi
205+
191206
# Restart master and test -O stop command with master using -N
192207
verbose "test $tid: cmd stop"
193208
trace "restart master, fork to background"
194209
start_mux_master
195210

211+
verbose "test $tid: cmd conninfo compression"
212+
conninfo=`${SSH} -F $OBJ/ssh_config -S $CTL -Oconninfo otherhost` \
213+
|| fail "request remote forward failed"
214+
if ! echo "$conninfo" | grep "compression zlib" >/dev/null ||
215+
! echo "$conninfo" | grep "compressed" >/dev/null ||
216+
! echo "$conninfo" | grep "kexalgorithm curve25519-sha256" >/dev/null ||
217+
! echo "$conninfo" | grep "cipher aes128-ctr" >/dev/null; then
218+
fail "conninfo compression"
219+
fi
220+
196221
# start a long-running command then immediately request a stop
197222
${SSH} -F $OBJ/ssh_config -S $CTL otherhost "sleep 10; exit 0" \
198223
>>$TEST_REGRESS_LOGFILE 2>&1 &

regress/test-exec.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $OpenBSD: test-exec.sh,v 1.135 2025/11/24 23:56:58 djm Exp $
1+
# $OpenBSD: test-exec.sh,v 1.136 2025/12/05 06:55:22 dtucker Exp $
22
# Placed in the Public Domain.
33

44
#SUDO=sudo
@@ -910,6 +910,12 @@ start_sshd ()
910910
test -f $PIDFILE || fatal "no sshd running on port $PORT"
911911
}
912912

913+
enable_all_kexes_in_sshd ()
914+
{
915+
kexs=`$SSH -Q KexAlgorithms | tr '\n' , | sed 's/,$//'`
916+
echo KexAlgorithms $kexs >>$OBJ/sshd_config
917+
}
918+
913919
# Find a PKCS#11 library.
914920
p11_find_lib() {
915921
TEST_SSH_PKCS11=""

0 commit comments

Comments
 (0)