diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2024-02-09 08:47:43 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2024-02-09 08:47:43 +0000 |
commit | 1339b40db49438d9a4408b4c06294865c72c8320 (patch) | |
tree | 043f9903338eba2b5a58e17950598088c9345866 /regress/usr.bin | |
parent | b7de4acb80da9fbf632ed53761d705f5e859a600 (diff) |
Factor out PuTTY setup and call when needed.
This allows us to avoid PuTTY key setup when it's not needed, which
speeds up the overall test run by a couple of percent.
Diffstat (limited to 'regress/usr.bin')
-rw-r--r-- | regress/usr.bin/ssh/putty-ciphers.sh | 13 | ||||
-rw-r--r-- | regress/usr.bin/ssh/putty-kex.sh | 13 | ||||
-rw-r--r-- | regress/usr.bin/ssh/putty-transfer.sh | 13 | ||||
-rw-r--r-- | regress/usr.bin/ssh/test-exec.sh | 24 |
4 files changed, 29 insertions, 34 deletions
diff --git a/regress/usr.bin/ssh/putty-ciphers.sh b/regress/usr.bin/ssh/putty-ciphers.sh index 5b8e25a2719..6b832733cd2 100644 --- a/regress/usr.bin/ssh/putty-ciphers.sh +++ b/regress/usr.bin/ssh/putty-ciphers.sh @@ -1,18 +1,9 @@ -# $OpenBSD: putty-ciphers.sh,v 1.11 2021/09/01 03:16:06 dtucker Exp $ +# $OpenBSD: putty-ciphers.sh,v 1.12 2024/02/09 08:47:42 dtucker Exp $ # Placed in the Public Domain. tid="putty ciphers" -if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then - skip "putty interop tests not enabled" -fi - -# Re-enable ssh-rsa on older PuTTY versions. -oldver="`${PLINK} --version | awk '/plink: Release/{if ($3<0.76)print "yes"}'`" -if [ "x$oldver" = "xyes" ]; then - echo "HostKeyAlgorithms +ssh-rsa" >> ${OBJ}/sshd_proxy - echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> ${OBJ}/sshd_proxy -fi +puttysetup for c in aes 3des aes128-ctr aes192-ctr aes256-ctr chacha20 ; do verbose "$tid: cipher $c" diff --git a/regress/usr.bin/ssh/putty-kex.sh b/regress/usr.bin/ssh/putty-kex.sh index c75802a0610..9df15be5890 100644 --- a/regress/usr.bin/ssh/putty-kex.sh +++ b/regress/usr.bin/ssh/putty-kex.sh @@ -1,18 +1,9 @@ -# $OpenBSD: putty-kex.sh,v 1.9 2021/09/01 03:16:06 dtucker Exp $ +# $OpenBSD: putty-kex.sh,v 1.10 2024/02/09 08:47:42 dtucker Exp $ # Placed in the Public Domain. tid="putty KEX" -if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then - skip "putty interop tests not enabled" -fi - -# Re-enable ssh-rsa on older PuTTY versions. -oldver="`${PLINK} --version | awk '/plink: Release/{if ($3<0.76)print "yes"}'`" -if [ "x$oldver" = "xyes" ]; then - echo "HostKeyAlgorithms +ssh-rsa" >> ${OBJ}/sshd_proxy - echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> ${OBJ}/sshd_proxy -fi +puttysetup for k in dh-gex-sha1 dh-group1-sha1 dh-group14-sha1 ecdh ; do verbose "$tid: kex $k" diff --git a/regress/usr.bin/ssh/putty-transfer.sh b/regress/usr.bin/ssh/putty-transfer.sh index a6864f9515a..1920f49ac8d 100644 --- a/regress/usr.bin/ssh/putty-transfer.sh +++ b/regress/usr.bin/ssh/putty-transfer.sh @@ -1,18 +1,9 @@ -# $OpenBSD: putty-transfer.sh,v 1.11 2021/09/01 03:16:06 dtucker Exp $ +# $OpenBSD: putty-transfer.sh,v 1.12 2024/02/09 08:47:42 dtucker Exp $ # Placed in the Public Domain. tid="putty transfer data" -if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then - skip "putty interop tests not enabled" -fi - -# Re-enable ssh-rsa on older PuTTY versions. -oldver="`${PLINK} --version | awk '/plink: Release/{if ($3<0.76)print "yes"}'`" -if [ "x$oldver" = "xyes" ]; then - echo "HostKeyAlgorithms +ssh-rsa" >> ${OBJ}/sshd_proxy - echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> ${OBJ}/sshd_proxy -fi +puttysetup if [ "`${SSH} -Q compression`" = "none" ]; then comp="0" diff --git a/regress/usr.bin/ssh/test-exec.sh b/regress/usr.bin/ssh/test-exec.sh index 1dba670a7ef..2143cbe16b1 100644 --- a/regress/usr.bin/ssh/test-exec.sh +++ b/regress/usr.bin/ssh/test-exec.sh @@ -1,4 +1,4 @@ -# $OpenBSD: test-exec.sh,v 1.105 2023/10/31 04:15:40 dtucker Exp $ +# $OpenBSD: test-exec.sh,v 1.106 2024/02/09 08:47:42 dtucker Exp $ # Placed in the Public Domain. #SUDO=sudo @@ -571,6 +571,11 @@ case "$SCRIPT" in esac if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then + puttysetup() { + if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then + skip "putty interop tests not enabled" + fi + mkdir -p ${OBJ}/.putty # Add a PuTTY key to authorized_keys @@ -602,6 +607,23 @@ if test "$REGRESS_INTEROP_PUTTY" = "yes" ; then echo "ProxyMethod=5" >> ${OBJ}/.putty/sessions/localhost_proxy echo "ProxyTelnetCommand=${OBJ}/sshd-log-wrapper.sh -i -f $OBJ/sshd_proxy" >> ${OBJ}/.putty/sessions/localhost_proxy echo "ProxyLocalhost=1" >> ${OBJ}/.putty/sessions/localhost_proxy + + PUTTYVER="`${PLINK} --version | awk '/plink: Release/{print $3}'`" + PUTTYMINORVER="`echo ${PUTTYVER} | cut -f2 -d.`" + verbose "plink version ${PUTTYVER} minor ${PUTTYMINORVER}" + + # Re-enable ssh-rsa on older PuTTY versions since they don't do newer + # key types. + if [ "$PUTTYMINORVER" -lt "76" ]; then + echo "HostKeyAlgorithms +ssh-rsa" >> ${OBJ}/sshd_proxy + echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> ${OBJ}/sshd_proxy + fi + + if [ "$PUTTYMINORVER" -le "64" ]; then + echo "KexAlgorithms +diffie-hellman-group14-sha1" \ + >>${OBJ}/sshd_proxy + fi + } fi REGRESS_INTEROP_DROPBEAR=no |