summaryrefslogtreecommitdiff
path: root/debian/patches/regress-integrity-robust.patch
blob: fe8a321c35b33c1a5b27ec1a598bafaa7c6992d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 11f55875afff41aa1f1732ff138c9f76dc2a0afa Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@debian.org>
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 1df2924f..ed378337 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