putty-ciphers.sh revision 1.10
1#	$OpenBSD: putty-ciphers.sh,v 1.10 2021/09/01 00:50:27 dtucker Exp $
2#	Placed in the Public Domain.
3
4tid="putty ciphers"
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" >> sshd_config
14fi
15
16for c in aes 3des aes128-ctr aes192-ctr aes256-ctr chacha20 ; do
17	verbose "$tid: cipher $c"
18	cp ${OBJ}/.putty/sessions/localhost_proxy \
19	    ${OBJ}/.putty/sessions/cipher_$c
20	echo "Cipher=$c" >> ${OBJ}/.putty/sessions/cipher_$c
21
22	rm -f ${COPY}
23	env HOME=$PWD ${PLINK} -load cipher_$c -batch -i ${OBJ}/putty.rsa2 \
24	    cat ${DATA} > ${COPY}
25	if [ $? -ne 0 ]; then
26		fail "ssh cat $DATA failed"
27	fi
28	cmp ${DATA} ${COPY}		|| fail "corrupted copy"
29done
30rm -f ${COPY}
31
32