Negative check too.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20119 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-02-01 20:28:04 +00:00
parent 0fdc34167b
commit c2fc3006d8

View File

@@ -198,16 +198,38 @@ ${kdigest} digest-server-request \
--type=CHAP \
--username="$username" \
--opaque="$opaque" \
--client-response="$cresponseData" \
--server-identifier="$identifier" \
--server-nonce="$snonce" \
> s2digest-reply || exitcode=1
sresponseData=`grep responseData= s2digest-reply | cut -f2- -d=`
status=`grep status= s2digest-reply | cut -f2- -d=`
if test "$cresponseData" = "$sresponseData" ; then
echo "CHAP response matches"
if test "X$status" = "Xok" ; then
echo "CHAP response ok"
else
echo "CHAP response doesnt match"
echo "CHAP response failed"
exitcode=1
fi
cresponseData=`echo $cresponseData | sed 's/..../DEADBEEF/'`
${kdigest} digest-server-request \
--kerberos-realm=${R} \
--type=CHAP \
--username="$username" \
--opaque="$opaque" \
--client-response="$cresponseData" \
--server-identifier="$identifier" \
--server-nonce="$snonce" \
> s2digest-reply || exitcode=1
status=`grep status= s2digest-reply | cut -f2- -d=`
if test "X$status" = "Xfailed" ; then
echo "CHAP response fail as it should"
else
echo "CHAP response succeeded errorously"
exitcode=1
fi