2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-02 07:35:26 +00:00

There's no real difference between the "sring" and "dring" parameters, so

call them "ring1" and "ring2" instead.  Also remove a bogus assertion.
This commit is contained in:
Brian Wellington
2000-07-21 22:38:31 +00:00
parent 87f4c7933f
commit 3b2efab212
2 changed files with 9 additions and 12 deletions

View File

@@ -15,7 +15,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
/* $Id: tsig.h,v 1.26 2000/07/21 20:53:59 bwelling Exp $ */ /* $Id: tsig.h,v 1.27 2000/07/21 22:38:31 bwelling Exp $ */
#ifndef DNS_TSIG_H #ifndef DNS_TSIG_H
#define DNS_TSIG_H 1 #define DNS_TSIG_H 1
@@ -155,7 +155,7 @@ dns_tsig_sign(dns_message_t *msg);
isc_result_t isc_result_t
dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg, dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg,
dns_tsig_keyring_t *sring, dns_tsig_keyring_t *dring); dns_tsig_keyring_t *ring1, dns_tsig_keyring_t *ring2);
/* /*
* Verifies the TSIG record in this message * Verifies the TSIG record in this message
* *
@@ -165,8 +165,7 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg,
* 'msg->tsigkey' is a valid TSIG key if this is a response * 'msg->tsigkey' is a valid TSIG key if this is a response
* 'msg->tsig' is NULL * 'msg->tsig' is NULL
* 'msg->querytsig' is not NULL if this is a response * 'msg->querytsig' is not NULL if this is a response
* 'sring' is a valid keyring or NULL * 'ring1' and 'ring2' are each either a valid keyring or NULL
* 'dring' is a valid keyring or NULL
* *
* Returns: * Returns:
* ISC_R_SUCCESS * ISC_R_SUCCESS

View File

@@ -16,7 +16,7 @@
*/ */
/* /*
* $Id: tsig.c,v 1.76 2000/07/21 20:53:58 bwelling Exp $ * $Id: tsig.c,v 1.77 2000/07/21 22:38:29 bwelling Exp $
* Principal Author: Brian Wellington * Principal Author: Brian Wellington
*/ */
@@ -549,7 +549,7 @@ cleanup_other:
isc_result_t isc_result_t
dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg, dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg,
dns_tsig_keyring_t *sring, dns_tsig_keyring_t *dring) dns_tsig_keyring_t *ring1, dns_tsig_keyring_t *ring2)
{ {
dns_rdata_any_tsig_t tsig, querytsig; dns_rdata_any_tsig_t tsig, querytsig;
isc_region_t r, source_r, header_r, sig_r; isc_region_t r, source_r, header_r, sig_r;
@@ -636,15 +636,13 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg,
*/ */
if (tsigkey == NULL) { if (tsigkey == NULL) {
ret = ISC_R_NOTFOUND; ret = ISC_R_NOTFOUND;
if (sring != NULL) if (ring1 != NULL)
ret = dns_tsigkey_find(&tsigkey, keyname, ret = dns_tsigkey_find(&tsigkey, keyname,
&tsig.algorithm, sring); &tsig.algorithm, ring1);
if (ret == ISC_R_NOTFOUND && dring != NULL) if (ret == ISC_R_NOTFOUND && ring2 != NULL)
ret = dns_tsigkey_find(&tsigkey, keyname, ret = dns_tsigkey_find(&tsigkey, keyname,
&tsig.algorithm, dring); &tsig.algorithm, ring2);
if (ret != ISC_R_SUCCESS) { if (ret != ISC_R_SUCCESS) {
if (dring == NULL)
return (DNS_R_TSIGVERIFYFAILURE);
msg->tsigstatus = dns_tsigerror_badkey; msg->tsigstatus = dns_tsigerror_badkey;
ret = dns_tsigkey_create(keyname, &tsig.algorithm, ret = dns_tsigkey_create(keyname, &tsig.algorithm,
NULL, 0, ISC_FALSE, NULL, NULL, 0, ISC_FALSE, NULL,