1*e9e8876aSEd Maste# $OpenBSD: putty-kex.sh,v 1.9 2021/09/01 03:16:06 dtucker Exp $ 2ce3adf43SDag-Erling Smørgrav# Placed in the Public Domain. 3ce3adf43SDag-Erling Smørgrav 4ce3adf43SDag-Erling Smørgravtid="putty KEX" 5ce3adf43SDag-Erling Smørgrav 6ce3adf43SDag-Erling Smørgravif test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then 7*e9e8876aSEd Maste skip "putty interop tests not enabled" 8*e9e8876aSEd Mastefi 9*e9e8876aSEd Maste 10*e9e8876aSEd Maste# Re-enable ssh-rsa on older PuTTY versions. 11*e9e8876aSEd Masteoldver="`${PLINK} --version | awk '/plink: Release/{if ($3<0.76)print "yes"}'`" 12*e9e8876aSEd Masteif [ "x$oldver" = "xyes" ]; then 13*e9e8876aSEd Maste echo "HostKeyAlgorithms +ssh-rsa" >> ${OBJ}/sshd_proxy 14*e9e8876aSEd Maste echo "PubkeyAcceptedKeyTypes +ssh-rsa" >> ${OBJ}/sshd_proxy 15ce3adf43SDag-Erling Smørgravfi 16ce3adf43SDag-Erling Smørgrav 1719261079SEd Mastefor k in dh-gex-sha1 dh-group1-sha1 dh-group14-sha1 ecdh ; do 18ce3adf43SDag-Erling Smørgrav verbose "$tid: kex $k" 19ce3adf43SDag-Erling Smørgrav cp ${OBJ}/.putty/sessions/localhost_proxy \ 20ce3adf43SDag-Erling Smørgrav ${OBJ}/.putty/sessions/kex_$k 21ce3adf43SDag-Erling Smørgrav echo "KEX=$k" >> ${OBJ}/.putty/sessions/kex_$k 22ce3adf43SDag-Erling Smørgrav 2347dd1d1bSDag-Erling Smørgrav env HOME=$PWD ${PLINK} -load kex_$k -batch -i ${OBJ}/putty.rsa2 true 24ce3adf43SDag-Erling Smørgrav if [ $? -ne 0 ]; then 25ce3adf43SDag-Erling Smørgrav fail "KEX $k failed" 26ce3adf43SDag-Erling Smørgrav fi 27ce3adf43SDag-Erling Smørgravdone 28ce3adf43SDag-Erling Smørgrav 29