summaryrefslogtreecommitdiff
path: root/regress/integrity.sh
diff options
context:
space:
mode:
authorTim Rice <tim@multitalents.net>2013-02-26 20:27:29 -0800
committerTim Rice <tim@multitalents.net>2013-02-26 20:27:29 -0800
commitf9e2060ca9d350733ac82ed9858b010a2b1ba5c1 (patch)
treed2f9bdeb8b3f15658e4ae1a09108d64c3c857ec8 /regress/integrity.sh
parenta514bc05b180c8fb3b11a387b20513743fb1837d (diff)
- (tim) [regress/integrity.sh] shell portability fix.
Diffstat (limited to 'regress/integrity.sh')
-rw-r--r--regress/integrity.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/regress/integrity.sh b/regress/integrity.sh
index 78fb53260..8ed8d080e 100644
--- a/regress/integrity.sh
+++ b/regress/integrity.sh
@@ -35,8 +35,8 @@ for m in $macs; do
35 emac=0 35 emac=0
36 ecnt=0 36 ecnt=0
37 skip=0 37 skip=0
38 for off in $(jot $tries $startoffset); do 38 for off in `jot $tries $startoffset`; do
39 skip=$((skip - 1)) 39 skip=`expr $skip - 1`
40 if [ $skip -gt 0 ]; then 40 if [ $skip -gt 0 ]; then
41 # avoid modifying the high bytes of the length 41 # avoid modifying the high bytes of the length
42 continue 42 continue
@@ -47,19 +47,19 @@ for m in $macs; do
47 aes*gcm*) macopt="-c $m";; 47 aes*gcm*) macopt="-c $m";;
48 *) macopt="-m $m";; 48 *) macopt="-m $m";;
49 esac 49 esac
50 output=$(${SSH} $macopt -2F $OBJ/ssh_proxy -o "$pxy" \ 50 output=`${SSH} $macopt -2F $OBJ/ssh_proxy -o "$pxy" \
51 999.999.999.999 'printf "%4096s" " "' 2>&1) 51 999.999.999.999 'printf "%4096s" " "' 2>&1`
52 if [ $? -eq 0 ]; then 52 if [ $? -eq 0 ]; then
53 fail "ssh -m $m succeeds with bit-flip at $off" 53 fail "ssh -m $m succeeds with bit-flip at $off"
54 fi 54 fi
55 ecnt=$((ecnt+1)) 55 ecnt=`expr $ecnt + 1`
56 output=$(echo $output | tr -s '\r\n' '.') 56 output=`echo $output | tr -s '\r\n' '.'`
57 verbose "test $tid: $m @$off $output" 57 verbose "test $tid: $m @$off $output"
58 case "$output" in 58 case "$output" in
59 Bad?packet*) elen=$((elen+1)); skip=3;; 59 Bad?packet*) elen=`expr $elen + 1`; skip=3;;
60 Corrupted?MAC* | Decryption?integrity?check?failed*) 60 Corrupted?MAC* | Decryption?integrity?check?failed*)
61 emac=$((emac+1)); skip=0;; 61 emac=`expr $emac + 1`; skip=0;;
62 padding*) epad=$((epad+1)); skip=0;; 62 padding*) epad=`expr $epad + 1`; skip=0;;
63 *) fail "unexpected error mac $m at $off";; 63 *) fail "unexpected error mac $m at $off";;
64 esac 64 esac
65 done 65 done
@@ -67,7 +67,7 @@ for m in $macs; do
67 if [ $emac -eq 0 ]; then 67 if [ $emac -eq 0 ]; then
68 fail "$m: no mac errors" 68 fail "$m: no mac errors"
69 fi 69 fi
70 expect=$((ecnt-epad-elen)) 70 expect=`expr $ecnt - $epad - $elen`
71 if [ $emac -ne $expect ]; then 71 if [ $emac -ne $expect ]; then
72 fail "$m: expected $expect mac errors, got $emac" 72 fail "$m: expected $expect mac errors, got $emac"
73 fi 73 fi