djm@openbsd.org | 73282b6 | 2018-02-23 03:03:00 +0000 | [diff] [blame] | 1 | # $OpenBSD: putty-transfer.sh,v 1.6 2018/02/23 03:03:00 djm Exp $ |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="putty transfer data" |
| 5 | |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 6 | if test "x$REGRESS_INTEROP_PUTTY" != "xyes" ; then |
Damien Miller | 3f94aaf | 2009-02-16 15:21:39 +1100 | [diff] [blame] | 7 | echo "putty interop tests not enabled" |
| 8 | exit 0 |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 9 | fi |
| 10 | |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 11 | for c in 0 1 ; do |
| 12 | verbose "$tid: compression $c" |
| 13 | rm -f ${COPY} |
| 14 | cp ${OBJ}/.putty/sessions/localhost_proxy \ |
| 15 | ${OBJ}/.putty/sessions/compression_$c |
| 16 | echo "Compression=$c" >> ${OBJ}/.putty/sessions/kex_$k |
| 17 | env HOME=$PWD ${PLINK} -load compression_$c -batch \ |
Darren Tucker | b5974de | 2018-03-23 13:21:14 +1100 | [diff] [blame] | 18 | -i ${OBJ}/putty.rsa2 cat ${DATA} > ${COPY} |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 19 | if [ $? -ne 0 ]; then |
| 20 | fail "ssh cat $DATA failed" |
| 21 | fi |
| 22 | cmp ${DATA} ${COPY} || fail "corrupted copy" |
| 23 | |
| 24 | for s in 10 100 1k 32k 64k 128k 256k; do |
| 25 | trace "compression $c dd-size ${s}" |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 26 | rm -f ${COPY} |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 27 | dd if=$DATA obs=${s} 2> /dev/null | \ |
| 28 | env HOME=$PWD ${PLINK} -load compression_$c \ |
Darren Tucker | b5974de | 2018-03-23 13:21:14 +1100 | [diff] [blame] | 29 | -batch -i ${OBJ}/putty.rsa2 \ |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 30 | "cat > ${COPY}" |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 31 | if [ $? -ne 0 ]; then |
| 32 | fail "ssh cat $DATA failed" |
| 33 | fi |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 34 | cmp $DATA ${COPY} || fail "corrupted copy" |
Damien Miller | af78493 | 2008-03-13 00:17:00 +1100 | [diff] [blame] | 35 | done |
| 36 | done |
| 37 | rm -f ${COPY} |
| 38 | |