Commit 382e38f4 authored by Giovanni Bajo's avatar Giovanni Bajo Committed by Simon Kelley

Specify the correct place where to canonicalize RR within RRset.

parent 9940aba9
...@@ -169,9 +169,12 @@ static int validate_rrsig(struct dns_header *header, size_t pktlen, ...@@ -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, ...@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment