- (tim) [regress/integrity.sh] shell portability fix.

This commit is contained in:
Tim Rice 2013-02-26 20:27:29 -08:00
parent a514bc05b1
commit f9e2060ca9
2 changed files with 11 additions and 10 deletions

View File

@ -2,6 +2,7 @@
- (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
[contrib/suse/openssh.spec] Crank version numbers [contrib/suse/openssh.spec] Crank version numbers
- (tim) [regress/forward-control.sh] use sh in case login shell is csh. - (tim) [regress/forward-control.sh] use sh in case login shell is csh.
- (tim) [regress/integrity.sh] shell portability fix.
20130226 20130226
- OpenBSD CVS Sync - OpenBSD CVS Sync

View File

@ -35,8 +35,8 @@ for m in $macs; do
emac=0 emac=0
ecnt=0 ecnt=0
skip=0 skip=0
for off in $(jot $tries $startoffset); do for off in `jot $tries $startoffset`; do
skip=$((skip - 1)) skip=`expr $skip - 1`
if [ $skip -gt 0 ]; then if [ $skip -gt 0 ]; then
# avoid modifying the high bytes of the length # avoid modifying the high bytes of the length
continue continue
@ -47,19 +47,19 @@ for m in $macs; do
aes*gcm*) macopt="-c $m";; aes*gcm*) macopt="-c $m";;
*) macopt="-m $m";; *) macopt="-m $m";;
esac esac
output=$(${SSH} $macopt -2F $OBJ/ssh_proxy -o "$pxy" \ output=`${SSH} $macopt -2F $OBJ/ssh_proxy -o "$pxy" \
999.999.999.999 'printf "%4096s" " "' 2>&1) 999.999.999.999 'printf "%4096s" " "' 2>&1`
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
fail "ssh -m $m succeeds with bit-flip at $off" fail "ssh -m $m succeeds with bit-flip at $off"
fi fi
ecnt=$((ecnt+1)) ecnt=`expr $ecnt + 1`
output=$(echo $output | tr -s '\r\n' '.') output=`echo $output | tr -s '\r\n' '.'`
verbose "test $tid: $m @$off $output" verbose "test $tid: $m @$off $output"
case "$output" in case "$output" in
Bad?packet*) elen=$((elen+1)); skip=3;; Bad?packet*) elen=`expr $elen + 1`; skip=3;;
Corrupted?MAC* | Decryption?integrity?check?failed*) Corrupted?MAC* | Decryption?integrity?check?failed*)
emac=$((emac+1)); skip=0;; emac=`expr $emac + 1`; skip=0;;
padding*) epad=$((epad+1)); skip=0;; padding*) epad=`expr $epad + 1`; skip=0;;
*) fail "unexpected error mac $m at $off";; *) fail "unexpected error mac $m at $off";;
esac esac
done done
@ -67,7 +67,7 @@ for m in $macs; do
if [ $emac -eq 0 ]; then if [ $emac -eq 0 ]; then
fail "$m: no mac errors" fail "$m: no mac errors"
fi fi
expect=$((ecnt-epad-elen)) expect=`expr $ecnt - $epad - $elen`
if [ $emac -ne $expect ]; then if [ $emac -ne $expect ]; then
fail "$m: expected $expect mac errors, got $emac" fail "$m: expected $expect mac errors, got $emac"
fi fi