summaryrefslogtreecommitdiff
path: root/regress/integrity.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/integrity.sh')
-rw-r--r--regress/integrity.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/regress/integrity.sh b/regress/integrity.sh
index 39d310deb..fd7d58bcb 100644
--- a/regress/integrity.sh
+++ b/regress/integrity.sh
@@ -5,8 +5,6 @@ tid="integrity"
5cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak 5cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak
6 6
7# start at byte 2900 (i.e. after kex) and corrupt at different offsets 7# start at byte 2900 (i.e. after kex) and corrupt at different offsets
8# XXX the test hangs if we modify the low bytes of the packet length
9# XXX and ssh tries to read...
10tries=10 8tries=10
11startoffset=2900 9startoffset=2900
12macs=`${SSH} -Q mac` 10macs=`${SSH} -Q mac`
@@ -27,6 +25,7 @@ for m in $macs; do
27 elen=0 25 elen=0
28 epad=0 26 epad=0
29 emac=0 27 emac=0
28 etmo=0
30 ecnt=0 29 ecnt=0
31 skip=0 30 skip=0
32 for off in `jot $tries $startoffset`; do 31 for off in `jot $tries $startoffset`; do
@@ -61,14 +60,16 @@ for m in $macs; do
61 Corrupted?MAC* | *message?authentication?code?incorrect*) 60 Corrupted?MAC* | *message?authentication?code?incorrect*)
62 emac=`expr $emac + 1`; skip=0;; 61 emac=`expr $emac + 1`; skip=0;;
63 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;;
64 *) fail "unexpected error mac $m at $off: $out";; 65 *) fail "unexpected error mac $m at $off: $out";;
65 esac 66 esac
66 done 67 done
67 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"
68 if [ $emac -eq 0 ]; then 69 if [ $emac -eq 0 ]; then
69 fail "$m: no mac errors" 70 fail "$m: no mac errors"
70 fi 71 fi
71 expect=`expr $ecnt - $epad - $elen` 72 expect=`expr $ecnt - $epad - $elen - $etmo`
72 if [ $emac -ne $expect ]; then 73 if [ $emac -ne $expect ]; then
73 fail "$m: expected $expect mac errors, got $emac" 74 fail "$m: expected $expect mac errors, got $emac"
74 fi 75 fi