]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3208. [bug] 'dig -y' handle unknown tsig alorithm better.
authorMark Andrews <marka@isc.org>
Sun, 6 Nov 2011 23:33:43 +0000 (23:33 +0000)
committerMark Andrews <marka@isc.org>
Sun, 6 Nov 2011 23:33:43 +0000 (23:33 +0000)
                        [RT #25522]

CHANGES
bin/dig/dighost.c
bin/tests/system/tsig/tests.sh

diff --git a/CHANGES b/CHANGES
index 0925a742cbee39270d2d7b5c71fcd6973b230956..de822c47cc02161a5c8d1f98be1ed5d354fdb712 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3208.  [bug]           'dig -y' handle unknown tsig alorithm better.
+                       [RT #25522]
+
 3207.  [contrib]       Fixed build error in Berkeley DB DLZ module. [RT #26444]
 
 3206.  [cleanup]       Add ISC information to log at start time. [RT #25484]
index 99b93fdd83e6de67929816708a3f55d0d5f5181a..8befb2b75d7db3fabcc0f6d7e70e24cfd13231b5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dighost.c,v 1.311.70.21 2011/03/11 10:49:49 marka Exp $ */
+/* $Id: dighost.c,v 1.311.70.22 2011/11/06 23:33:42 marka Exp $ */
 
 /*! \file
  *  \note
@@ -65,6 +65,7 @@
 #include <dns/tsig.h>
 
 #include <dst/dst.h>
+#include <dst/result.h>
 
 #include <isc/app.h>
 #include <isc/base64.h>
@@ -901,8 +902,12 @@ setup_text_key(void) {
 
        secretsize = isc_buffer_usedlength(&secretbuf);
 
-       result = dns_name_fromtext(&keyname, namebuf,
-                                  dns_rootname, ISC_FALSE,
+        if (hmacname == NULL) {
+                result = DST_R_UNSUPPORTEDALG;
+                goto failure;
+        }
+
+       result = dns_name_fromtext(&keyname, namebuf, dns_rootname, ISC_FALSE,
                                   namebuf);
        if (result != ISC_R_SUCCESS)
                goto failure;
index d2391c167be803996cab1f0cd2b0413f092858b0..00b9df4057e725e9daa829fcca407a21a81a5ceb 100644 (file)
@@ -14,7 +14,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.5 2007/06/19 23:47:06 tbox Exp $
+# $Id: tests.sh,v 1.5.332.1 2011/11/06 23:33:43 marka Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -213,6 +213,15 @@ if [ $ret -eq 1 ] ; then
        echo "I: failed"; status=1
 fi
 
+echo "I:attempting fetch with bad tsig algorithm"
+ret=0
+$DIG +tcp +nosea +nostat +noquest +nocomm +nocmd example.nil.\
+       -y "badalgo:invalid:$sha512" @10.53.0.1 soa -p 5300 > dig.out.badalgo 2>&1 || ret=1
+grep -i "Couldn't create key invalid: algorithm is unsupported" dig.out.badalgo > /dev/null || ret=1
+if [ $ret -eq 1 ] ; then
+       echo "I: failed"; status=1
+fi
+
 exit $status