From 989ce98a71063acb2a13f35977b962125c07d1b2 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sun, 1 Jan 2017 15:21:10 +0000 Subject: Make integrity tests more robust against timeouts If the first test in a series for a given MAC happens to modify the low bytes of a packet length, then ssh will time out and this will be interpreted as a test failure. Handle this failure mode. Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=2658 Patch-Name: regress-integrity-robust.patch Last-Update: 2017-01-01 --- regress/integrity.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/regress/integrity.sh b/regress/integrity.sh index 1df2924f5..ed3783372 100644 --- a/regress/integrity.sh +++ b/regress/integrity.sh @@ -60,14 +60,16 @@ for m in $macs; do Corrupted?MAC* | *message?authentication?code?incorrect*) emac=`expr $emac + 1`; skip=0;; padding*) epad=`expr $epad + 1`; skip=0;; + *Timeout,?server*) + etmo=`expr $etmo + 1`; skip=0;; *) fail "unexpected error mac $m at $off: $out";; esac done - verbose "test $tid: $ecnt errors: mac $emac padding $epad length $elen" + verbose "test $tid: $ecnt errors: mac $emac padding $epad length $elen timeout $etmo" if [ $emac -eq 0 ]; then fail "$m: no mac errors" fi - expect=`expr $ecnt - $epad - $elen` + expect=`expr $ecnt - $epad - $elen - $etmo` if [ $emac -ne $expect ]; then fail "$m: expected $expect mac errors, got $emac" fi -- cgit v1.2.3