mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
a few error cases were handled wrong
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: tsig.c,v 1.24 1999/10/27 19:59:34 bwelling Exp $
|
* $Id: tsig.c,v 1.25 1999/10/28 22:05:23 bwelling Exp $
|
||||||
* Principal Author: Brian Wellington
|
* Principal Author: Brian Wellington
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -435,16 +435,12 @@ dns_tsig_sign(dns_message_t *msg) {
|
|||||||
goto cleanup_signature;
|
goto cleanup_signature;
|
||||||
ret = isc_buffer_allocate(msg->mctx, &dynbuf, 512,
|
ret = isc_buffer_allocate(msg->mctx, &dynbuf, 512,
|
||||||
ISC_BUFFERTYPE_BINARY);
|
ISC_BUFFERTYPE_BINARY);
|
||||||
if (ret != ISC_R_SUCCESS) {
|
if (ret != ISC_R_SUCCESS)
|
||||||
isc_buffer_free(&dynbuf);
|
|
||||||
goto cleanup_signature;
|
goto cleanup_signature;
|
||||||
}
|
|
||||||
ret = dns_rdata_fromstruct(rdata, dns_rdataclass_any,
|
ret = dns_rdata_fromstruct(rdata, dns_rdataclass_any,
|
||||||
dns_rdatatype_tsig, tsig, dynbuf);
|
dns_rdatatype_tsig, tsig, dynbuf);
|
||||||
if (ret != ISC_R_SUCCESS) {
|
if (ret != ISC_R_SUCCESS)
|
||||||
isc_buffer_free(&dynbuf);
|
|
||||||
goto cleanup_dynbuf;
|
goto cleanup_dynbuf;
|
||||||
}
|
|
||||||
|
|
||||||
dns_message_takebuffer(msg, &dynbuf);
|
dns_message_takebuffer(msg, &dynbuf);
|
||||||
msg->tsig = tsig;
|
msg->tsig = tsig;
|
||||||
@@ -471,6 +467,7 @@ dns_tsig_sign(dns_message_t *msg) {
|
|||||||
goto cleanup_dynbuf;
|
goto cleanup_dynbuf;
|
||||||
datalist->rdclass = dns_rdataclass_any;
|
datalist->rdclass = dns_rdataclass_any;
|
||||||
datalist->type = dns_rdatatype_tsig;
|
datalist->type = dns_rdatatype_tsig;
|
||||||
|
datalist->covers = 0;
|
||||||
datalist->ttl = 0;
|
datalist->ttl = 0;
|
||||||
ISC_LIST_INIT(datalist->rdata);
|
ISC_LIST_INIT(datalist->rdata);
|
||||||
ISC_LIST_APPEND(datalist->rdata, rdata, link);
|
ISC_LIST_APPEND(datalist->rdata, rdata, link);
|
||||||
|
Reference in New Issue
Block a user