Darren Tucker | fc8a7ea | 2003-06-18 22:18:57 +1000 | [diff] [blame] | 1 | # $OpenBSD: rekey.sh,v 1.1 2003/03/28 13:58:28 markus Exp $ |
| 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="rekey during transfer data" |
| 5 | |
| 6 | DATA=${OBJ}/data |
| 7 | COPY=${OBJ}/copy |
| 8 | LOG=${OBJ}/log |
| 9 | |
| 10 | rm -f ${COPY} ${LOG} ${DATA} |
Darren Tucker | 5caa78b | 2004-12-20 12:35:42 +1100 | [diff] [blame] | 11 | touch ${DATA} |
Darren Tucker | 60de9f1 | 2003-09-04 14:02:56 +1000 | [diff] [blame] | 12 | dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1 |
Darren Tucker | fc8a7ea | 2003-06-18 22:18:57 +1000 | [diff] [blame] | 13 | |
| 14 | for s in 16 1k 128k 256k; do |
| 15 | trace "rekeylimit ${s}" |
| 16 | rm -f ${COPY} |
| 17 | cat $DATA | \ |
| 18 | ${SSH} -oCompression=no -oRekeyLimit=$s \ |
| 19 | -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}" \ |
| 20 | 2> ${LOG} |
| 21 | if [ $? -ne 0 ]; then |
| 22 | fail "ssh failed" |
| 23 | fi |
| 24 | cmp $DATA ${COPY} || fail "corrupted copy" |
| 25 | n=`grep 'NEWKEYS sent' ${LOG} | wc -l` |
| 26 | n=`expr $n - 1` |
| 27 | trace "$n rekeying(s)" |
| 28 | if [ $n -lt 1 ]; then |
| 29 | fail "no rekeying occured" |
| 30 | fi |
| 31 | done |
| 32 | rm -f ${COPY} ${LOG} ${DATA} |