Commit ef6a36d9 authored by Brian Wellington's avatar Brian Wellington
Browse files

tsig signed queries by the resolver both didn't always work and leaked memory.

parent 83c45e69
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: resolver.c,v 1.182 2000/11/15 04:53:06 marka Exp $ */ /* $Id: resolver.c,v 1.183 2000/11/22 23:16:04 bwelling Exp $ */
#include <config.h> #include <config.h>
...@@ -401,6 +401,9 @@ fctx_cancelquery(resquery_t **queryp, dns_dispatchevent_t **deventp, ...@@ -401,6 +401,9 @@ fctx_cancelquery(resquery_t **queryp, dns_dispatchevent_t **deventp,
if (query->tsig != NULL) if (query->tsig != NULL)
isc_buffer_free(&query->tsig); isc_buffer_free(&query->tsig);
if (query->tsigkey != NULL)
dns_tsigkey_detach(&query->tsigkey);
/* /*
* Check for any outstanding socket events. If they exist, cancel * Check for any outstanding socket events. If they exist, cancel
* them and let the event handlers finish the cleanup. The resolver * them and let the event handlers finish the cleanup. The resolver
...@@ -3936,6 +3939,12 @@ resquery_response(isc_task_t *task, isc_event_t *event) { ...@@ -3936,6 +3939,12 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
goto done; goto done;
} }
if (query->tsigkey) {
result = dns_message_settsigkey(message, query->tsigkey);
if (result != ISC_R_SUCCESS)
goto done;
}
result = dns_message_parse(message, &devent->buffer, 0); result = dns_message_parse(message, &devent->buffer, 0);
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
switch (result) { switch (result) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment