2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

changes to the rdata_tostruct api had broken tsig/tkey

This commit is contained in:
Brian Wellington
2000-05-19 22:11:20 +00:00
parent f5eb48652c
commit c610d78e67
2 changed files with 30 additions and 5 deletions

View File

@@ -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