diff options
author | Colin Watson <cjwatson@debian.org> | 2017-01-01 15:21:10 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-08-22 16:24:44 +0100 |
commit | 11f55875afff41aa1f1732ff138c9f76dc2a0afa (patch) | |
tree | 6a109dc8b4014ac0bafa5a3bd7acc091617a897b | |
parent | cf60afd3438c444e20b114fbd799168002c74aae (diff) |
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
-rw-r--r-- | regress/integrity.sh | 6 |
1 files 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 | |||
60 | Corrupted?MAC* | *message?authentication?code?incorrect*) | 60 | Corrupted?MAC* | *message?authentication?code?incorrect*) |
61 | emac=`expr $emac + 1`; skip=0;; | 61 | emac=`expr $emac + 1`; skip=0;; |
62 | padding*) epad=`expr $epad + 1`; skip=0;; | 62 | padding*) epad=`expr $epad + 1`; skip=0;; |
63 | *Timeout,?server*) | ||
64 | etmo=`expr $etmo + 1`; skip=0;; | ||
63 | *) fail "unexpected error mac $m at $off: $out";; | 65 | *) fail "unexpected error mac $m at $off: $out";; |
64 | esac | 66 | esac |
65 | done | 67 | done |
66 | verbose "test $tid: $ecnt errors: mac $emac padding $epad length $elen" | 68 | verbose "test $tid: $ecnt errors: mac $emac padding $epad length $elen timeout $etmo" |
67 | if [ $emac -eq 0 ]; then | 69 | if [ $emac -eq 0 ]; then |
68 | fail "$m: no mac errors" | 70 | fail "$m: no mac errors" |
69 | fi | 71 | fi |
70 | expect=`expr $ecnt - $epad - $elen` | 72 | expect=`expr $ecnt - $epad - $elen - $etmo` |
71 | if [ $emac -ne $expect ]; then | 73 | if [ $emac -ne $expect ]; then |
72 | fail "$m: expected $expect mac errors, got $emac" | 74 | fail "$m: expected $expect mac errors, got $emac" |
73 | fi | 75 | fi |