From 24694ab18a48bcc9c50304bd8b7eb6b9c7650129 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Fri, 10 Sep 1999 14:54:10 +0000 Subject: [PATCH] new fields needed for TCP-TSIG --- lib/dns/include/dns/message.h | 2 ++ lib/dns/message.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/dns/include/dns/message.h b/lib/dns/include/dns/message.h index ea19b7d6fb..6fd0719ef4 100644 --- a/lib/dns/include/dns/message.h +++ b/lib/dns/include/dns/message.h @@ -157,6 +157,7 @@ struct dns_message { unsigned int need_cctx_cleanup : 1; unsigned int header_ok : 1; unsigned int question_ok : 1; + unsigned int tcp_continuation: 1; unsigned int reserved; /* reserved space (render) */ @@ -181,6 +182,7 @@ struct dns_message { dns_rdata_any_tsig_t *tsig; dns_rdata_any_tsig_t *querytsig; dns_tsig_key_t *tsigkey; + void *tsigctx; int tsigstart; }; diff --git a/lib/dns/message.c b/lib/dns/message.c index 5f03679cfd..64d250694b 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -322,6 +322,7 @@ msginittsig(dns_message_t *m) m->tsigstatus = m->querytsigstatus = dns_rcode_noerror; m->tsig = m->querytsig = NULL; m->tsigkey = NULL; + m->tsigctx = NULL; m->tsigstart = -1; } @@ -337,6 +338,7 @@ msginit(dns_message_t *m) msginittsig(m); m->header_ok = 0; m->question_ok = 0; + m->tcp_continuation = 0; } static inline void @@ -1219,8 +1221,13 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source, if (r.length != 0) return (DNS_R_FORMERR); - if (!ISC_LIST_EMPTY(msg->sections[DNS_SECTION_TSIG])) { - ret = dns_tsig_verify(source, msg); + if (msg->tsigkey != NULL || + !ISC_LIST_EMPTY(msg->sections[DNS_SECTION_TSIG])) + { + if (!msg->tcp_continuation) + ret = dns_tsig_verify(source, msg); + else + ret = dns_tsig_verify_tcp(source, msg); if (ret != DNS_R_SUCCESS) return ret; } -- GitLab