]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
send over and undersized cookie
authorMark Andrews <marka@isc.org>
Tue, 5 Feb 2019 23:40:03 +0000 (10:40 +1100)
committerMark Andrews <marka@isc.org>
Wed, 6 Feb 2019 02:13:11 +0000 (13:13 +1100)
(cherry picked from commit 0207199bb88a9ffc6b62af13ec5953cb098e3346)

bin/tests/system/cookie/tests.sh

index 598a9b9ab29e71865b6f71611c9fa9c7547cc0b3..0c4d25a77ab303cfd5a0f91616098f1adef844b9 100755 (executable)
@@ -184,6 +184,30 @@ if [ $linecount != 2 ]; then ret=1; fi
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo_i "send undersized cookie ($n)"
+ret=0
+$DIG $DIGOPTS +qr +cookie=000000 soa @10.53.0.1 > dig.out.test$n || ret=1
+grep "status: FORMERR" dig.out.test$n > /dev/null || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo_i "send oversized for named cookie ($n)"
+ret=0
+$DIG $DIGOPTS +qr +cookie=${cookie}00 soa @10.53.0.1 > dig.out.test$n || ret=1
+grep "COOKIE: [a-f0-9]* (good)" dig.out.test$n > /dev/null 2>&1 || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
+n=`expr $n + 1`
+echo_i "send oversized for named cookie with server requiring a good cookie ($n)"
+ret=0
+$DIG $DIGOPTS +qr +cookie=${cookie}00 soa @10.53.0.3 > dig.out.test$n || ret=1
+grep "COOKIE: [a-f0-9]* (good)" dig.out.test$n > /dev/null 2>&1 || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
 #
 # Test shared cookie-secret support.
 #