]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Don't check compressions stats when ssh does not support
authordtucker@openbsd.org <dtucker@openbsd.org>
Sat, 6 Dec 2025 03:23:27 +0000 (03:23 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Sat, 6 Dec 2025 03:45:46 +0000 (14:45 +1100)
compression.

OpenBSD-Regress-ID: 026db51b2654a949e9a10b908443dab83b64c74a

regress/multiplex.sh

index 6b58387f318d93a8ed4fca9e0362eb1e1a5d1818..f68af935e456b9617fe390a99386f6725891ecad 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: multiplex.sh,v 1.39 2025/12/05 08:09:34 dtucker Exp $
+#      $OpenBSD: multiplex.sh,v 1.40 2025/12/06 03:23:27 dtucker Exp $
 #      Placed in the Public Domain.
 
 tid="connection multiplexing"
@@ -198,31 +198,39 @@ kill -0 $SSH_PID >/dev/null 2>&1 && fail "exit command failed"
 
 # Enable compression and alternative kex for next conninfo test.
 if $SSH -Q compression | grep zlib@openssh.com >/dev/null; then
-       echo compression yes >>$OBJ/ssh_config
-       echo kexalgorithms curve25519-sha256 >>$OBJ/ssh_config
-       echo ciphers aes128-ctr >>$OBJ/ssh_config
+       compression=yes
+else
+       compression=no
 fi
+echo compression $compression >>$OBJ/ssh_config
+echo kexalgorithms curve25519-sha256 >>$OBJ/ssh_config
+echo ciphers aes128-ctr >>$OBJ/ssh_config
 
 # Restart master and test -O stop command with master using -N
 verbose "test $tid: cmd stop"
 trace "restart master, fork to background"
 start_mux_master
 
-verbose "test $tid: cmd conninfo compression"
+verbose "test $tid: cmd conninfo algos"
 conninfo=`${SSH} -F $OBJ/ssh_config -S $CTL -Oconninfo otherhost` \
      || fail "request remote forward failed"
-if ! echo "$conninfo" | grep "compression zlib" >/dev/null ||
-    ! echo "$conninfo" | grep "compressed" >/dev/null ||
-    ! echo "$conninfo" | grep "kexalgorithm curve25519-sha256" >/dev/null ||
+if ! echo "$conninfo" | grep "kexalgorithm curve25519-sha256" >/dev/null ||
     ! echo "$conninfo" | grep "cipher aes128-ctr" >/dev/null; then
-       fail "conninfo compression"
+       fail "conninfo algos"
+fi
+if [ "$compression" = "yes" ]; then
+       verbose "test $tid: cmd conninfo compression"
+       if ! echo "$conninfo" | grep "compression zlib" >/dev/null ||
+           ! echo "$conninfo" | grep "compressed" >/dev/null; then
+               fail "conninfo compression"
+       fi
 fi
 
 # start a long-running command then immediately request a stop
 ${SSH} -F $OBJ/ssh_config -S $CTL otherhost "sleep 10; exit 0" \
      >>$TEST_REGRESS_LOGFILE 2>&1 &
 SLEEP_PID=$!
-${SSH} -F $OBJ/ssh_config -S $CTL -Ostop otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
+${SSH} -F$OBJ/ssh_config -S$CTL -Ostop otherhost >>$TEST_REGRESS_LOGFILE 2>&1 \
     || fail "send stop command failed"
 
 # wait until both long-running command and master have exited.