View | Details | Raw Unified | Return to bug 2658
Collapse All | Expand All

(-)a/regress/integrity.sh (-5 / +5 lines)
Lines 5-12 tid="integrity" Link Here
5
cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak
5
cp $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...
10
tries=10
8
tries=10
11
startoffset=2900
9
startoffset=2900
12
macs=`${SSH} -Q mac`
10
macs=`${SSH} -Q mac`
Lines 27-32 for m in $macs; do Link Here
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
Lines 61-74 for m in $macs; do Link Here
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
75
- 

Return to bug 2658