]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
712. [bug] Sending a large signed update message caused an
authorBrian Wellington <source@isc.org>
Sat, 27 Jan 2001 02:28:33 +0000 (02:28 +0000)
committerBrian Wellington <source@isc.org>
Sat, 27 Jan 2001 02:28:33 +0000 (02:28 +0000)
                        assertion failure. [RT #718]

- Resetting a message should clear the TSIG/SIG(0) sections
- Rerendering a message if the first try returned USETCP should not call
  dns_message_settsigkey() again.

CHANGES
lib/dns/message.c
lib/dns/request.c

diff --git a/CHANGES b/CHANGES
index fe75208978e5c8f8e0cc3e83623274002632db4a..78e420f7799879ec400a2069bca57d08f480f380 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,7 @@
 
+ 712.  [bug]           Sending a large signed update message caused an
+                       assertion failure. [RT #718]
+
  711.  [bug]           The libisc and liblwres implementations of
                        inet_ntop contained an off by one error.
 
index cfd55cccc0a1bb94b53664706c9e315ac90dbc25..f5955650a520c4a8e571cc0b1826f1fd20be8fe0 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: message.c,v 1.173 2001/01/18 00:26:34 bwelling Exp $ */
+/* $Id: message.c,v 1.174 2001/01/27 02:28:33 bwelling Exp $ */
 
 /***
  *** Imports
@@ -1982,6 +1982,16 @@ dns_message_renderreset(dns_message_t *msg) {
                        }
                }
        }
+       if (msg->tsigname != NULL)
+               dns_message_puttempname(msg, &msg->tsigname);
+       if (msg->tsig != NULL) {
+               dns_rdataset_disassociate(msg->tsig);
+               dns_message_puttemprdataset(msg, &msg->tsig);
+       }
+       if (msg->sig0 != NULL) {
+               dns_rdataset_disassociate(msg->sig0);
+               dns_message_puttemprdataset(msg, &msg->sig0);
+       }
 }
 
 isc_result_t
index 88c153cc45b57de52b6a5f49a73597a4c2aae24c..387eede68988d74205a1856a607e6f1a180446b6 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: request.c,v 1.53 2001/01/23 19:50:10 bwelling Exp $ */
+/* $Id: request.c,v 1.54 2001/01/27 02:28:32 bwelling Exp $ */
 
 #include <config.h>
 
@@ -788,6 +788,7 @@ dns_request_createvia(dns_requestmgr_t *requestmgr, dns_message_t *message,
        isc_mem_t *mctx;
        dns_messageid_t id;
        isc_boolean_t tcp;
+       isc_boolean_t setkey = ISC_TRUE;
 
        REQUIRE(VALID_REQUESTMGR(requestmgr));
        REQUIRE(message != NULL);
@@ -850,7 +851,8 @@ dns_request_createvia(dns_requestmgr_t *requestmgr, dns_message_t *message,
                goto cleanup;
 
        message->id = id;
-       dns_message_settsigkey(message, request->tsigkey);
+       if (setkey)
+               dns_message_settsigkey(message, request->tsigkey);
        result = req_render(message, &request->query, options, mctx);
        if (result == DNS_R_USETCP &&
            (options & DNS_REQUESTOPT_TCP) == 0) {
@@ -862,6 +864,7 @@ dns_request_createvia(dns_requestmgr_t *requestmgr, dns_message_t *message,
                dns_dispatch_detach(&request->dispatch);
                socket = NULL;
                options |= DNS_REQUESTOPT_TCP;
+               setkey = ISC_FALSE;
                goto use_tcp;
        }
        if (result != ISC_R_SUCCESS)