summaryrefslogtreecommitdiff
path: root/regress/rekey.sh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-05-17 09:42:34 +1000
committerDarren Tucker <dtucker@zip.com.au>2013-05-17 09:42:34 +1000
commita8a62fcc46c19997797846197a6256ed9a777a47 (patch)
tree736e78a01114e03b48829e425695cd623147ff3a /regress/rekey.sh
parent5e95173715d516e6014485e2b6def1fb3db84036 (diff)
downloadopenssh-git-a8a62fcc46c19997797846197a6256ed9a777a47.tar.gz
- dtucker@cvs.openbsd.org 2013/05/16 02:10:35
[rekey.sh] Add test for time-based rekeying
Diffstat (limited to 'regress/rekey.sh')
-rw-r--r--regress/rekey.sh23
1 files changed, 21 insertions, 2 deletions
diff --git a/regress/rekey.sh b/regress/rekey.sh
index d2542ecd..24d6c965 100644
--- a/regress/rekey.sh
+++ b/regress/rekey.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: rekey.sh,v 1.3 2013/04/07 02:16:03 dtucker Exp $
+# $OpenBSD: rekey.sh,v 1.4 2013/05/16 02:10:35 dtucker Exp $
# Placed in the Public Domain.
tid="rekey during transfer data"
@@ -13,7 +13,7 @@ dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1
for s in 16 1k 128k 256k; do
trace "rekeylimit ${s}"
- rm -f ${COPY}
+ rm -f ${COPY} ${LOG}
cat $DATA | \
${SSH} -oCompression=no -oRekeyLimit=$s \
-v -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
@@ -28,4 +28,23 @@ for s in 16 1k 128k 256k; do
fail "no rekeying occured"
fi
done
+
+for s in 5 10 15 ; do
+ trace "rekeylimit default ${s}"
+ rm -f ${COPY} ${LOG}
+ cat $DATA | \
+ ${SSH} -oCompression=no -oRekeyLimit="default $s" -F \
+ $OBJ/ssh_proxy somehost "cat >${COPY};sleep $s;sleep 5"
+ 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
+
rm -f ${COPY} ${DATA}