putty-transfer.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # $OpenBSD: putty-transfer.sh,v 1.7 2020/01/23 11:19:12 dtucker Exp $
  2. # Placed in the Public Domain.
  3. tid="putty transfer data"
  4. if test "x$REGRESS_INTEROP_PUTTY" != "xyes"; then
  5. echo "putty interop tests not enabled"
  6. exit 0
  7. fi
  8. if [ "$(${SSH} -Q compression)" = "none" ]; then
  9. comp="0"
  10. else
  11. comp="0 1"
  12. fi
  13. for c in $comp; do
  14. verbose "$tid: 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 ${OBJ}/putty.rsa2 cat ${DATA} > ${COPY}
  21. if [ $? -ne 0 ]; then
  22. fail "ssh cat $DATA failed"
  23. fi
  24. cmp ${DATA} ${COPY} || fail "corrupted copy"
  25. for s in 10 100 1k 32k 64k 128k 256k; do
  26. trace "compression $c dd-size ${s}"
  27. rm -f ${COPY}
  28. dd if=$DATA obs=${s} 2> /dev/null |
  29. env HOME=$PWD ${PLINK} -load compression_$c \
  30. -batch -i ${OBJ}/putty.rsa2 \
  31. "cat > ${COPY}"
  32. if [ $? -ne 0 ]; then
  33. fail "ssh cat $DATA failed"
  34. fi
  35. cmp $DATA ${COPY} || fail "corrupted copy"
  36. done
  37. done
  38. rm -f ${COPY}