diff options
Diffstat (limited to 'debian/patches/regress-integrity-robust.patch')
-rw-r--r-- | debian/patches/regress-integrity-robust.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/debian/patches/regress-integrity-robust.patch b/debian/patches/regress-integrity-robust.patch new file mode 100644 index 000000000..651a7a88e --- /dev/null +++ b/debian/patches/regress-integrity-robust.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | From 7ce93c802065cd926e7cbfd10e629f3a2d352301 Mon Sep 17 00:00:00 2001 | ||
2 | From: Colin Watson <cjwatson@debian.org> | ||
3 | Date: Sun, 1 Jan 2017 15:21:10 +0000 | ||
4 | Subject: Make integrity tests more robust against timeouts | ||
5 | |||
6 | If the first test in a series for a given MAC happens to modify the low | ||
7 | bytes of a packet length, then ssh will time out and this will be | ||
8 | interpreted as a test failure. Handle this failure mode. | ||
9 | |||
10 | Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=2658 | ||
11 | Patch-Name: regress-integrity-robust.patch | ||
12 | |||
13 | Last-Update: 2017-01-01 | ||
14 | --- | ||
15 | regress/integrity.sh | 9 +++++---- | ||
16 | 1 file changed, 5 insertions(+), 4 deletions(-) | ||
17 | |||
18 | diff --git a/regress/integrity.sh b/regress/integrity.sh | ||
19 | index 39d310de..fd7d58bc 100644 | ||
20 | --- a/regress/integrity.sh | ||
21 | +++ b/regress/integrity.sh | ||
22 | @@ -5,8 +5,6 @@ tid="integrity" | ||
23 | cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak | ||
24 | |||
25 | # start at byte 2900 (i.e. after kex) and corrupt at different offsets | ||
26 | -# XXX the test hangs if we modify the low bytes of the packet length | ||
27 | -# XXX and ssh tries to read... | ||
28 | tries=10 | ||
29 | startoffset=2900 | ||
30 | macs=`${SSH} -Q mac` | ||
31 | @@ -27,6 +25,7 @@ for m in $macs; do | ||
32 | elen=0 | ||
33 | epad=0 | ||
34 | emac=0 | ||
35 | + etmo=0 | ||
36 | ecnt=0 | ||
37 | skip=0 | ||
38 | for off in `jot $tries $startoffset`; do | ||
39 | @@ -61,14 +60,16 @@ for m in $macs; do | ||
40 | Corrupted?MAC* | *message?authentication?code?incorrect*) | ||
41 | emac=`expr $emac + 1`; skip=0;; | ||
42 | padding*) epad=`expr $epad + 1`; skip=0;; | ||
43 | + *Timeout,?server*) | ||
44 | + etmo=`expr $etmo + 1`; skip=0;; | ||
45 | *) fail "unexpected error mac $m at $off: $out";; | ||
46 | esac | ||
47 | done | ||
48 | - verbose "test $tid: $ecnt errors: mac $emac padding $epad length $elen" | ||
49 | + verbose "test $tid: $ecnt errors: mac $emac padding $epad length $elen timeout $etmo" | ||
50 | if [ $emac -eq 0 ]; then | ||
51 | fail "$m: no mac errors" | ||
52 | fi | ||
53 | - expect=`expr $ecnt - $epad - $elen` | ||
54 | + expect=`expr $ecnt - $epad - $elen - $etmo` | ||
55 | if [ $emac -ne $expect ]; then | ||
56 | fail "$m: expected $expect mac errors, got $emac" | ||
57 | fi | ||