summaryrefslogtreecommitdiff
path: root/regress/rekey.sh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-11-07 15:08:02 +1100
committerDarren Tucker <dtucker@zip.com.au>2013-11-07 15:08:02 +1100
commit06595d639577577bc15d359e037a31eb83563269 (patch)
tree12321783db1cb174d92819b80126d7b45490d725 /regress/rekey.sh
parent651dc8b2592202dac6b16ee3b82ce5b331be7da3 (diff)
downloadopenssh-git-06595d639577577bc15d359e037a31eb83563269.tar.gz
- dtucker@cvs.openbsd.org 2013/11/07 01:12:51
[regress/rekey.sh] Factor out the data transfer rekey tests
Diffstat (limited to 'regress/rekey.sh')
-rw-r--r--regress/rekey.sh74
1 files changed, 26 insertions, 48 deletions
diff --git a/regress/rekey.sh b/regress/rekey.sh
index 156179b3..7131a6f0 100644
--- a/regress/rekey.sh
+++ b/regress/rekey.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: rekey.sh,v 1.10 2013/11/07 00:12:05 dtucker Exp $
+# $OpenBSD: rekey.sh,v 1.11 2013/11/07 01:12:51 dtucker Exp $
# Placed in the Public Domain.
tid="rekey"
@@ -7,6 +7,25 @@ LOG=${TEST_SSH_LOGFILE}
rm -f ${LOG}
+# Test rekeying based on data volume only.
+# Arguments will be passed to ssh.
+ssh_data_rekeying()
+{
+ rm -f ${COPY} ${LOG}
+ ${SSH} <${DATA} -oCompression=no $@ -v -F $OBJ/ssh_proxy somehost \
+ "cat > ${COPY}"
+ 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
+}
+
opts=""
for i in `${SSH} -Q kex`; do
opts="$opts KexAlgorithms=$i"
@@ -20,20 +39,7 @@ done
for opt in $opts; do
verbose "client rekey $opt"
- rm -f ${COPY} ${LOG}
- cat $DATA | \
- ${SSH} -oCompression=no -oRekeyLimit=16 -o$opt \
- -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
- 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
+ ssh_data_rekeying -oRekeyLimit=16 -o$opt
done
# GCM is magical so test with all KexAlgorithms
@@ -41,53 +47,25 @@ if ${SSH} -Q cipher | grep gcm@openssh.com >/dev/null ; then
for c in `${SSH} -Q cipher | grep gcm@openssh.com`; do
for kex in `${SSH} -Q kex`; do
verbose "client rekey $c $kex"
- rm -f ${COPY} ${LOG}
- cat $DATA | \
- ${SSH} -oCompression=no -oRekeyLimit=16 \
- -oCiphers=$c -oKexAlgorithms=$kex \
- -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
- 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
+ ssh_data_rekeying -oRekeyLimit=16 -oCiphers=$c -oKexAlgorithms=$kex
done
done
fi
for s in 16 1k 128k 256k; do
verbose "client rekeylimit ${s}"
- rm -f ${COPY} ${LOG}
- cat $DATA | \
- ${SSH} -oCompression=no -oRekeyLimit=$s \
- -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
- 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
+ ssh_data_rekeying -oCompression=no -oRekeyLimit=$s
done
for s in 5 10; do
verbose "client 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 3"
+ ${SSH} < ${DATA} -oCompression=no -oRekeyLimit="default $s" -F \
+ $OBJ/ssh_proxy somehost "cat >${COPY};sleep $s;sleep 3"
if [ $? -ne 0 ]; then
fail "ssh failed"
fi
- cmp $DATA ${COPY} || fail "corrupted copy"
+ cmp ${DATA} ${COPY} || fail "corrupted copy"
n=`grep 'NEWKEYS sent' ${LOG} | wc -l`
n=`expr $n - 1`
trace "$n rekeying(s)"