]> 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:24:12 +0000 (22:24 +0000)
committerEvan Hunt <each@isc.org>
Mon, 23 May 2011 22:24:12 +0000 (22:24 +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 41eb58289b4cb2f07287efdfa4a1b129e30cc9b9..127c4bfa0f774be6d90f7bc489e4aff6f0f4290d 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]
+
 3113.  [doc]           Document the relationship between serial-query-rate
                        and NOTIFY messages.
 
index 616e099c7bfd763919a40e901f4eff9f68f44519..2a1380d5712ced406ebf08fb089962c7f8132c7d 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nsupdate.c,v 1.163.48.17 2011/03/12 04:57:24 tbox Exp $ */
+/* $Id: nsupdate.c,v 1.163.48.18 2011/05/23 22:24:12 each Exp $ */
 
 /*! \file */
 
@@ -617,8 +617,10 @@ setup_keyfile(void) {
                                keyfile, isc_result_totext(result));
                        return;
                }
-       } else
+       } else {
                dst_key_attach(dstkey, &sig0key);
+               dst_key_free(&dstkey);
+       }
 }
 
 static void
@@ -2707,6 +2709,9 @@ cleanup(void) {
        }
 #endif
 
+       if (sig0key != NULL)
+               dst_key_free(&sig0key);
+
        ddebug("Shutting down task manager");
        isc_taskmgr_destroy(&taskmgr);
 
index 10389fb83a61202e7699e3c35f2a9cec27335628..31c403e668033c8d1bf2fd8b0e41d0ef963305d2 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.12.250.2 2011/02/03 12:16:45 tbox Exp $
+# $Id: clean.sh,v 1.12.250.3 2011/05/23 22:24:12 each Exp $
 
 #
 # Clean up after zone transfer tests.
@@ -29,3 +29,4 @@ rm -f */named.memstats
 rm -f ns3/dnskey.test.db.signed.jnl ns3/dnskey.test.db ns3/dnskey.test.db.signed ns3/dsset-dnskey.test.
 rm -f ns3/K*
 rm -f dig.out.ns3.*
+rm -f Kxxx.*
index 4fe47e7885b543d8614a40b3212587059cede1cf..496b214fef98bff5e437d4be3381201bbd1c3501 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.25.332.2 2011/02/03 12:16:45 tbox Exp $
+# $Id: tests.sh,v 1.25.332.3 2011/05/23 22:24:12 each Exp $
 
 SYSTEMTESTTOP=..
 . $SYSTEMTESTTOP/conf.sh
@@ -59,6 +59,15 @@ echo "I:comparing post-update copies to known good data"
 $PERL ../digcomp.pl knowngood.ns1.after dig.out.ns1 || status=1
 $PERL ../digcomp.pl knowngood.ns1.after dig.out.ns2 || status=1
 
+ret=0
+echo "I:check SIG(0) key is accepted"
+key=`$KEYGEN -r random.data -a NSEC3RSASHA1 -b 512 -k -n ENTITY xxx 2> /dev/null`
+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
     echo "I:running update.pl test"