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

changes to the rdata_tostruct api had broken tsig/tkey

parent f5eb4865
......@@ -502,14 +502,35 @@ msgreset(dns_message_t *msg, isc_boolean_t everything) {
dns_compress_invalidate(&msg->cctx);
if (msg->tsig != NULL) {
dns_rdata_freestruct(msg->tsig);
if (msg->from_to_wire == DNS_MESSAGE_INTENTPARSE)
dns_rdata_freestruct(msg->tsig);
else {
if (msg->tsig->signature != NULL)
isc_mem_put(msg->mctx, msg->tsig->signature,
msg->tsig->siglen);
if (msg->tsig->other != NULL)
isc_mem_put(msg->mctx, msg->tsig->other,
msg->tsig->otherlen);
dns_name_free(&msg->tsig->algorithm, msg->mctx);
}
isc_mem_put(msg->mctx, msg->tsig,
sizeof(dns_rdata_any_tsig_t));
msg->tsig = NULL;
}
if (msg->querytsig != NULL) {
dns_rdata_freestruct(msg->querytsig);
if (msg->from_to_wire != DNS_MESSAGE_INTENTPARSE)
dns_rdata_freestruct(msg->querytsig);
else {
if (msg->querytsig->signature != NULL)
isc_mem_put(msg->mctx,
msg->querytsig->signature,
msg->querytsig->siglen);
if (msg->querytsig->other != NULL)
isc_mem_put(msg->mctx, msg->querytsig->other,
msg->querytsig->otherlen);
dns_name_free(&msg->querytsig->algorithm, msg->mctx);
}
isc_mem_put(msg->mctx, msg->querytsig,
sizeof(dns_rdata_any_tsig_t));
msg->querytsig = NULL;
......@@ -659,8 +680,8 @@ dns_message_reset(dns_message_t *msg, unsigned int intent) {
REQUIRE(intent == DNS_MESSAGE_INTENTPARSE
|| intent == DNS_MESSAGE_INTENTRENDER);
msg->from_to_wire = intent;
msgreset(msg, ISC_FALSE);
msg->from_to_wire = intent;
}
void
......
......@@ -16,7 +16,7 @@
*/
/*
* $Id: tkey.c,v 1.36 2000/05/19 00:20:52 bwelling Exp $
* $Id: tkey.c,v 1.37 2000/05/19 22:11:20 bwelling Exp $
* Principal Author: Brian Wellington
*/
......@@ -611,7 +611,11 @@ dns_tkey_processquery(dns_message_t *msg, dns_tkey_ctx_t *tctx,
RETERR(isc_buffer_allocate(msg->mctx, &dynbuf, 128));
result = dns_rdata_fromstruct(rdata, tkeyout.common.rdclass,
tkeyout.common.rdtype, &tkeyout, dynbuf);
dns_rdata_freestruct(&tkeyout);
dns_name_free(&tkeyout.algorithm, msg->mctx);
if (tkeyout.key != NULL)
isc_mem_put(msg->mctx, tkeyout.key, tkeyout.keylen);
if (tkeyout.other != NULL)
isc_mem_put(msg->mctx, tkeyout.other, tkeyout.otherlen);
if (result != ISC_R_SUCCESS)
goto failure;
......
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