diff --git a/lib/dns/message.c b/lib/dns/message.c index e635570fd3..fe82d8873f 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -1375,7 +1375,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source, if (r.length != 0) return (DNS_R_FORMERR); - if (msg->tsigset != NULL || msg->sig0 != NULL) { + if (msg->tsigset != NULL || msg->tsigkey != NULL || msg->sig0 != NULL) { msg->saved = isc_mem_get(msg->mctx, sizeof(isc_region_t)); if (msg->saved == NULL) return (ISC_R_NOMEMORY); diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c index b73746ef4c..7d9574b313 100644 --- a/lib/dns/tsig.c +++ b/lib/dns/tsig.c @@ -16,7 +16,7 @@ */ /* - * $Id: tsig.c,v 1.50 2000/04/06 22:02:27 explorer Exp $ + * $Id: tsig.c,v 1.51 2000/04/08 04:40:21 bwelling Exp $ * Principal Author: Brian Wellington */ @@ -887,9 +887,12 @@ dns_tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) { memcpy(&header[DNS_MESSAGE_HEADERLEN - 2], &addcount, 2); } - /* Put in the original id */ - id = htons(tsig->originalid); - memcpy(&header[0], &id, 2); + /* Put in the original id. */ + /* XXX Can TCP transfers be forwarded? How would that work? */ + if (tsig != NULL) { + id = htons(tsig->originalid); + memcpy(&header[0], &id, 2); + } /* Digest the modified header */ header_r.base = (unsigned char *) header;