• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#	$OpenBSD: putty-transfer.sh,v 1.4 2016/11/25 03:02:01 dtucker Exp $
2#	Placed in the Public Domain.
3
4tid="putty transfer data"
5
6if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then
7	echo "putty interop tests not enabled"
8	exit 0
9fi
10
11# XXX support protocol 1 too
12for p in 2; do
13	for c in 0 1 ; do
14	verbose "$tid: proto $p compression $c"
15		rm -f ${COPY}
16		cp ${OBJ}/.putty/sessions/localhost_proxy \
17		    ${OBJ}/.putty/sessions/compression_$c
18		echo "Compression=$c" >> ${OBJ}/.putty/sessions/kex_$k
19		env HOME=$PWD ${PLINK} -load compression_$c -batch \
20		    -i putty.rsa$p cat ${DATA} > ${COPY}
21		if [ $? -ne 0 ]; then
22			fail "ssh cat $DATA failed"
23		fi
24		cmp ${DATA} ${COPY}		|| fail "corrupted copy"
25
26		for s in 10 100 1k 32k 64k 128k 256k; do
27			trace "proto $p compression $c dd-size ${s}"
28			rm -f ${COPY}
29			dd if=$DATA obs=${s} 2> /dev/null | \
30				env HOME=$PWD ${PLINK} -load compression_$c \
31				    -batch -i putty.rsa$p \
32				    "cat > ${COPY}"
33			if [ $? -ne 0 ]; then
34				fail "ssh cat $DATA failed"
35			fi
36			cmp $DATA ${COPY}	|| fail "corrupted copy"
37		done
38	done
39done
40rm -f ${COPY}
41
42