summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordtucker <dtucker>2013-11-08 01:11:47 +0000
committerdtucker <dtucker>2013-11-08 01:11:47 +0000
commite75a88d4996edb1063d72dfe99077e5ed1a69247 (patch)
treea90a0ae5fbe2a8325ff12e9fc2be5833898e651a
parentc4560cad4faf6c0c415960bcf4f6f5770520fa30 (diff)
downloadopenssh-e75a88d4996edb1063d72dfe99077e5ed1a69247.tar.gz
- dtucker@cvs.openbsd.org 2013/11/08 01:06:14
[regress/rekey.sh] Rekey less frequently during tests to speed them up
-rw-r--r--regress/rekey.sh57
1 files changed, 44 insertions, 13 deletions
diff --git a/regress/rekey.sh b/regress/rekey.sh
index 8eb7efaf..6095da8d 100644
--- a/regress/rekey.sh
+++ b/regress/rekey.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: rekey.sh,v 1.8 2013/05/17 04:29:14 dtucker Exp $
+# $OpenBSD: rekey.sh,v 1.12 2013/11/08 01:06:14 dtucker Exp $
# Placed in the Public Domain.
tid="rekey"
@@ -7,34 +7,65 @@ LOG=${TEST_SSH_LOGFILE}
rm -f ${LOG}
-for s in 16 1k 128k 256k; do
- verbose "client rekeylimit ${s}"
+# Test rekeying based on data volume only.
+# Arguments will be passed to ssh.
+ssh_data_rekeying()
+{
rm -f ${COPY} ${LOG}
- cat $DATA | \
- ${SSH} -oCompression=no -oRekeyLimit=$s \
- -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
+ ${SSH} <${DATA} -oCompression=no $@ -v -F $OBJ/ssh_proxy somehost \
+ "cat > ${COPY}"
if [ $? -ne 0 ]; then
- fail "ssh failed"
+ 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)"
if [ $n -lt 1 ]; then
- fail "no rekeying occured"
+ fail "no rekeying occured ($@)"
fi
+}
+
+opts=""
+for i in `${SSH} -Q kex`; do
+ opts="$opts KexAlgorithms=$i"
+done
+for i in `${SSH} -Q cipher`; do
+ opts="$opts Ciphers=$i"
+done
+for i in `${SSH} -Q mac`; do
+ opts="$opts MACs=$i"
+done
+
+for opt in $opts; do
+ verbose "client rekey $opt"
+ ssh_data_rekeying -oRekeyLimit=256k -o$opt
+done
+
+# GCM is magical so test with all KexAlgorithms
+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"
+ ssh_data_rekeying -oRekeyLimit=256k -oCiphers=$c -oKexAlgorithms=$kex
+ done
+ done
+fi
+
+for s in 16 1k 128k 256k; do
+ verbose "client rekeylimit ${s}"
+ 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)"