mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Added dns_tsigkey_attach & _detach, to simplify reference counting.
Added dns_message_get/settsigkey to deuglify tsig key handling in message code.
This commit is contained in:
@@ -522,7 +522,7 @@ msgreset(dns_message_t *msg, isc_boolean_t everything) {
|
||||
}
|
||||
|
||||
if (msg->tsigkey != NULL) {
|
||||
dns_tsigkey_free(&msg->tsigkey);
|
||||
dns_tsigkey_detach(&msg->tsigkey);
|
||||
msg->tsigkey = NULL;
|
||||
}
|
||||
|
||||
@@ -2220,6 +2220,32 @@ dns_message_gettsig(dns_message_t *msg, dns_name_t **owner) {
|
||||
return (msg->tsigset);
|
||||
}
|
||||
|
||||
void
|
||||
dns_message_settsigkey(dns_message_t *msg, dns_tsigkey_t *key) {
|
||||
|
||||
/*
|
||||
* Set the TSIG key for 'msg'
|
||||
*/
|
||||
|
||||
REQUIRE(DNS_MESSAGE_VALID(msg));
|
||||
REQUIRE(msg->tsigkey == NULL);
|
||||
|
||||
if (key != NULL)
|
||||
dns_tsigkey_attach(key, &msg->tsigkey);
|
||||
}
|
||||
|
||||
dns_tsigkey_t *
|
||||
dns_message_gettsigkey(dns_message_t *msg) {
|
||||
|
||||
/*
|
||||
* Get the TSIG key for 'msg'
|
||||
*/
|
||||
|
||||
REQUIRE(DNS_MESSAGE_VALID(msg));
|
||||
|
||||
return (msg->tsigkey);
|
||||
}
|
||||
|
||||
dns_rdataset_t *
|
||||
dns_message_getsig0(dns_message_t *msg, dns_name_t **owner) {
|
||||
|
||||
|
Reference in New Issue
Block a user