]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2213. [bug] SIG0 diagnostic failure messages were looking at the
authorMark Andrews <marka@isc.org>
Wed, 22 Aug 2007 00:42:42 +0000 (00:42 +0000)
committerMark Andrews <marka@isc.org>
Wed, 22 Aug 2007 00:42:42 +0000 (00:42 +0000)
                        wrong status code. [RT #17101]

CHANGES
bin/named/client.c

diff --git a/CHANGES b/CHANGES
index 27f08bd70c0d72f20a2d8815cc472eb1f9d9d5d0..bf9f0b8ffa07db4a2332e3a22debf25f5851cb50 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+2213.  [bug]           SIG0 diagnostic failure messages were looking at the
+                       wrong status code. [RT #17101]
+
 2212.  [func]          'host -m' now causes memory statistics and active
                        memory to be printed at exit. [RT 17028]
 
index dcb0406c64e6de77a9f19c13e0be709de22d1e99..de49512a85aaab99f19c2943dbde377b318b5a90 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: client.c,v 1.248 2007/06/26 02:52:15 marka Exp $ */
+/* $Id: client.c,v 1.249 2007/08/22 00:42:42 marka Exp $ */
 
 #include <config.h>
 
@@ -1674,16 +1674,19 @@ client_request(isc_task_t *task, isc_event_t *event) {
                char tsigrcode[64];
                isc_buffer_t b;
                dns_name_t *name = NULL;
+               dns_rcode_t status;
+               isc_result_t tresult;
 
-               isc_buffer_init(&b, tsigrcode, sizeof(tsigrcode) - 1);
-               RUNTIME_CHECK(dns_tsigrcode_totext(client->message->tsigstatus,
-                                                  &b) == ISC_R_SUCCESS);
-               tsigrcode[isc_buffer_usedlength(&b)] = '\0';
                /* There is a signature, but it is bad. */
                if (dns_message_gettsig(client->message, &name) != NULL) {
                        char namebuf[DNS_NAME_FORMATSIZE];
                        char cnamebuf[DNS_NAME_FORMATSIZE];
                        dns_name_format(name, namebuf, sizeof(namebuf));
+                       status = client->message->tsigstatus;
+                       isc_buffer_init(&b, tsigrcode, sizeof(tsigrcode) - 1);
+                       tresult = dns_tsigrcode_totext(status, &b);
+                       INSIST(tresult == ISC_R_SUCCESS);
+                       tsigrcode[isc_buffer_usedlength(&b)] = '\0';
                        if (client->message->tsigkey->generated) {
                                dns_name_format(client->message->tsigkey->creator,
                                                cnamebuf, sizeof(cnamebuf));
@@ -1705,6 +1708,11 @@ client_request(isc_task_t *task, isc_event_t *event) {
                                              tsigrcode);
                        }
                } else {
+                       status = client->message->sig0status;
+                       isc_buffer_init(&b, tsigrcode, sizeof(tsigrcode) - 1);
+                       tresult = dns_tsigrcode_totext(status, &b);
+                       INSIST(tresult == ISC_R_SUCCESS);
+                       tsigrcode[isc_buffer_usedlength(&b)] = '\0';
                        ns_client_log(client, DNS_LOGCATEGORY_SECURITY,
                                      NS_LOGMODULE_CLIENT, ISC_LOG_ERROR,
                                      "request has invalid signature: %s (%s)",