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
54CTL=${SSH_REGRESS_TMP} /ctl-sock
65
76tid=" connection multiplexing"
87
98trace " will use ProxyCommand $proxycmd "
9+ make_tmpdir
1010if config_defined DISABLE_FD_PASSING ; then
1111 skip " not supported on this platform (FD passing disabled)"
1212fi
@@ -24,6 +24,7 @@ wait_for_mux_master_ready()
2424}
2525
2626maybe_add_scp_path_to_sshd
27+ enable_all_kexes_in_sshd
2728start_sshd
2829
2930start_mux_master ()
@@ -180,6 +181,13 @@ N=$(echo "xyzzy" | $NC -U $OBJ/unix-1.fwd 2>&1 | grep "xyzzy" | wc -l)
180181test ${N} -eq 0 || fail " remote forward path still listening"
181182rm -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+
183191verbose " 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
188196wait $SSH_PID
189197kill -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
192207verbose " test $tid : cmd stop"
193208trace " restart master, fork to background"
194209start_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 &
0 commit comments