mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-10 23:49:59 -04:00
dns_message_gettsig/getsig0 cleanup
This commit is contained in:
parent
c4bd4b1a8e
commit
7a97b7630f
2 changed files with 16 additions and 10 deletions
|
|
@ -944,11 +944,15 @@ dns_message_gettsig(dns_message_t *msg, dns_name_t **owner);
|
|||
* Requires:
|
||||
*
|
||||
* 'msg' is a valid message.
|
||||
* 'owner' is not NULL, and *owner is NULL. Contains the owner on return.
|
||||
* 'owner' is NULL or *owner is NULL.
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
* The TSIG rdataset of 'msg', or NULL if there isn't one.
|
||||
*
|
||||
* Ensures:
|
||||
*
|
||||
* If 'owner' is not NULL, it will point to the owner name.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
|
|
@ -1034,11 +1038,15 @@ dns_message_getsig0(dns_message_t *msg, dns_name_t **owner);
|
|||
* Requires:
|
||||
*
|
||||
* 'msg' is a valid message.
|
||||
* 'owner' is not NULL, and *owner is NULL. Contains the owner on return.
|
||||
* 'owner' is NULL or *owner is NULL.
|
||||
*
|
||||
* Returns:
|
||||
*
|
||||
* The SIG(0) rdataset of 'msg', or NULL if there isn't one.
|
||||
*
|
||||
* Ensures:
|
||||
*
|
||||
* If 'owner' is not NULL, it will point to the owner name.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
|
|
|
|||
|
|
@ -2296,9 +2296,10 @@ dns_message_gettsig(dns_message_t *msg, dns_name_t **owner) {
|
|||
*/
|
||||
|
||||
REQUIRE(DNS_MESSAGE_VALID(msg));
|
||||
REQUIRE(owner != NULL && *owner == NULL);
|
||||
REQUIRE(owner == NULL || *owner == NULL);
|
||||
|
||||
*owner = msg->tsigname;
|
||||
if (owner != NULL)
|
||||
*owner = msg->tsigname;
|
||||
return (msg->tsig);
|
||||
}
|
||||
|
||||
|
|
@ -2431,8 +2432,9 @@ dns_message_getsig0(dns_message_t *msg, dns_name_t **owner) {
|
|||
*/
|
||||
|
||||
REQUIRE(DNS_MESSAGE_VALID(msg));
|
||||
REQUIRE(owner == NULL || *owner == NULL);
|
||||
|
||||
if (msg->sig0 != NULL) {
|
||||
if (msg->sig0 != NULL && owner != NULL) {
|
||||
/* If dns_message_getsig0 is called on a rendered message
|
||||
* after the SIG(0) has been applied, we need to return the
|
||||
* root name, not NULL.
|
||||
|
|
@ -2441,12 +2443,8 @@ dns_message_getsig0(dns_message_t *msg, dns_name_t **owner) {
|
|||
*owner = dns_rootname;
|
||||
else
|
||||
*owner = msg->sig0name;
|
||||
return (msg->sig0);
|
||||
}
|
||||
else {
|
||||
*owner = NULL;
|
||||
return (NULL);
|
||||
}
|
||||
return (msg->sig0);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
|
|||
Loading…
Reference in a new issue