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