2013-05-16 23:19:10 +00:00
|
|
|
# $OpenBSD: rekey.sh,v 1.2 2013/04/06 06:00:22 dtucker Exp $
|
2003-06-18 12:18:57 +00:00
|
|
|
# Placed in the Public Domain.
|
|
|
|
|
|
|
|
tid="rekey during transfer data"
|
|
|
|
|
|
|
|
DATA=${OBJ}/data
|
|
|
|
COPY=${OBJ}/copy
|
2013-05-16 23:19:10 +00:00
|
|
|
LOG=${TEST_SSH_LOGFILE}
|
2003-06-18 12:18:57 +00:00
|
|
|
|
|
|
|
rm -f ${COPY} ${LOG} ${DATA}
|
2004-12-20 01:35:42 +00:00
|
|
|
touch ${DATA}
|
2003-09-04 04:02:56 +00:00
|
|
|
dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1
|
2003-06-18 12:18:57 +00:00
|
|
|
|
|
|
|
for s in 16 1k 128k 256k; do
|
|
|
|
trace "rekeylimit ${s}"
|
|
|
|
rm -f ${COPY}
|
|
|
|
cat $DATA | \
|
|
|
|
${SSH} -oCompression=no -oRekeyLimit=$s \
|
|
|
|
-v -F $OBJ/ssh_proxy somehost "cat > ${COPY}" \
|
|
|
|
2> ${LOG}
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
fail "ssh failed"
|
|
|
|
fi
|
|
|
|
cmp $DATA ${COPY} || fail "corrupted copy"
|
|
|
|
n=`grep 'NEWKEYS sent' ${LOG} | wc -l`
|
|
|
|
n=`expr $n - 1`
|
|
|
|
trace "$n rekeying(s)"
|
|
|
|
if [ $n -lt 1 ]; then
|
|
|
|
fail "no rekeying occured"
|
|
|
|
fi
|
|
|
|
done
|
2013-05-16 23:19:10 +00:00
|
|
|
rm -f ${COPY} ${DATA}
|