]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3118. [bug] nsupdate could dump core on shutdown when using
authorEvan Hunt <each@isc.org>
Mon, 23 May 2011 22:25:32 +0000 (22:25 +0000)
committerEvan Hunt <each@isc.org>
Mon, 23 May 2011 22:25:32 +0000 (22:25 +0000)
SIG(0) keys. [RT #24604]

CHANGES
bin/nsupdate/nsupdate.c
bin/tests/system/nsupdate/clean.sh
bin/tests/system/nsupdate/tests.sh

diff --git a/CHANGES b/CHANGES
index d41189cede5a458e9e9879ca16fd78d2182fbdda..05c2008f1031ab0822f20d04f3a09a313dd8de43 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3118.  [bug]           nsupdate could dump core on shutdown when using
+                       SIG(0) keys. [RT #24604]
+
 3117.  [cleanup]       Remove doc and parser references to the
                        never-implemented 'auto-dnssec create' option.
                        [RT #24533]
index c7c3521b9d976877d7acff0d6f907a8b906e7f0d..0b80f6377707d7160d9502fd2d764aab527351f5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsupdate.c,v 1.195 2011/03/21 19:54:02 each Exp $ */
+/* $Id: nsupdate.c,v 1.196 2011/05/23 22:25:32 each Exp $ */
 
 /*! \file */
 
@@ -695,8 +695,10 @@ setup_keyfile(isc_mem_t *mctx, isc_log_t *lctx) {
                                keyfile, isc_result_totext(result));
                        return;
                }
-       } else
+       } else {
                dst_key_attach(dstkey, &sig0key);
+               dst_key_free(&dstkey);
+       }
 }
 
 static void
index 535ae75bdaf4fde2b22ceac0de9a79aa5aaef73b..6f5285d8b141ed670877c7e5c450bb396a4291a0 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: clean.sh,v 1.23 2011/05/06 21:23:50 each Exp $
+# $Id: clean.sh,v 1.24 2011/05/23 22:25:32 each Exp $
 
 #
 # Clean up after zone transfer tests.
@@ -35,3 +35,4 @@ rm -f ns3/dnskey.test.db.signed.jnl ns3/dnskey.test.db ns3/dnskey.test.db.signed
 rm -f ns3/K*
 rm -f dig.out.ns3.*
 rm -f jp.out.ns3.*
+rm -f Kxxx.*
index 5cacc776c981fc2427a25cffd0c37fb269527e35..1bc363aa679a098a6c347aed0dc7b5f73af1a0ad 100644 (file)
@@ -15,7 +15,7 @@
 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 # PERFORMANCE OF THIS SOFTWARE.
 
-# $Id: tests.sh,v 1.36 2011/05/06 21:23:50 each Exp $
+# $Id: tests.sh,v 1.37 2011/05/23 22:25:32 each Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -140,6 +140,14 @@ grep ns4.other.nil dig.out.ns1 > /dev/null 2>&1 || status=1
 grep ns5.other.nil dig.out.ns1 > /dev/null 2>&1 || status=1
 grep ns6.other.nil dig.out.ns1 > /dev/null 2>&1 || status=1
 
+ret=0
+echo "I:check SIG(0) key is accepted"
+key=`$KEYGEN -q -r random.data -a NSEC3RSASHA1 -b 512 -T KEY -n ENTITY xxx`
+echo "" | $NSUPDATE -k ${key}.private > /dev/null 2>&1 || ret=1
+if [ $ret -ne 0 ]; then
+    echo "I:failed"
+    status=1
+fi
 
 if $PERL -e 'use Net::DNS;' 2>/dev/null
 then