Specify the correct place where to canonicalize RR within RRset.

This commit is contained in:
Giovanni Bajo
2012-04-24 01:46:47 +02:00
committed by Simon Kelley
parent 9940aba9f6
commit 382e38f494

View File

@@ -169,9 +169,12 @@ static int validate_rrsig(struct dns_header *header, size_t pktlen,
if (res == 1 && qtype == sigtype && qclass == sigclass) if (res == 1 && qtype == sigtype && qclass == sigclass)
{ {
++rrsetidx; ++rrsetidx;
assert(rrsetidx < countof(rrset)); if (rrsetidx == countof(rrset))
/* TODO: here we should convert to lowercase domain names within {
RDATA. We can do it in place. */ /* Internal buffer too small */
printf("internal buffer too small for this RRset\n");
return 0;
}
} }
p += rdlen; p += rdlen;
} }
@@ -205,6 +208,8 @@ static int validate_rrsig(struct dns_header *header, size_t pktlen,
p = (unsigned char*)(rrset[i]); p = (unsigned char*)(rrset[i]);
p += 8; p += 8;
GETSHORT(rdlen, p); GETSHORT(rdlen, p);
/* TODO: instead of a direct add_data(), we must call a RRtype-specific
function, that extract and canonicalizes domain names within RDATA. */
alg->add_data(p-2, rdlen+2); alg->add_data(p-2, rdlen+2);
} }
alg->end_data(); alg->end_data();