mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 16:15:27 +00:00
A couple minor bugs relating to TCP TSIG verification
This commit is contained in:
@@ -1375,7 +1375,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source,
|
|||||||
if (r.length != 0)
|
if (r.length != 0)
|
||||||
return (DNS_R_FORMERR);
|
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));
|
msg->saved = isc_mem_get(msg->mctx, sizeof(isc_region_t));
|
||||||
if (msg->saved == NULL)
|
if (msg->saved == NULL)
|
||||||
return (ISC_R_NOMEMORY);
|
return (ISC_R_NOMEMORY);
|
||||||
|
@@ -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
|
* 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);
|
memcpy(&header[DNS_MESSAGE_HEADERLEN - 2], &addcount, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Put in the original id */
|
/* Put in the original id. */
|
||||||
id = htons(tsig->originalid);
|
/* XXX Can TCP transfers be forwarded? How would that work? */
|
||||||
memcpy(&header[0], &id, 2);
|
if (tsig != NULL) {
|
||||||
|
id = htons(tsig->originalid);
|
||||||
|
memcpy(&header[0], &id, 2);
|
||||||
|
}
|
||||||
|
|
||||||
/* Digest the modified header */
|
/* Digest the modified header */
|
||||||
header_r.base = (unsigned char *) header;
|
header_r.base = (unsigned char *) header;
|
||||||
|
Reference in New Issue
Block a user