mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Handle DNSSEC-unaware upstream servers better.
This commit is contained in:
13
src/dnssec.c
13
src/dnssec.c
@@ -872,10 +872,18 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
|
|||||||
if (qtype != T_DS || qclass != class)
|
if (qtype != T_DS || qclass != class)
|
||||||
rc = STAT_BOGUS;
|
rc = STAT_BOGUS;
|
||||||
else
|
else
|
||||||
rc = dnssec_validate_reply(now, header, plen, name, keyname, NULL, 1, &neganswer, &nons);
|
rc = dnssec_validate_reply(now, header, plen, name, keyname, NULL, 0, &neganswer, &nons);
|
||||||
|
|
||||||
if (rc == STAT_INSECURE)
|
if (rc == STAT_INSECURE)
|
||||||
|
{
|
||||||
|
static int reported = 0;
|
||||||
|
if (!reported)
|
||||||
|
{
|
||||||
|
reported = 1;
|
||||||
|
my_syslog(LOG_WARNING, _("Insecure DS reply received, do upstream DNS servers support DNSSEC?"));
|
||||||
|
}
|
||||||
rc = STAT_BOGUS;
|
rc = STAT_BOGUS;
|
||||||
|
}
|
||||||
|
|
||||||
p = (unsigned char *)(header+1);
|
p = (unsigned char *)(header+1);
|
||||||
extract_name(header, plen, &p, name, 1, 4);
|
extract_name(header, plen, &p, name, 1, 4);
|
||||||
@@ -1906,7 +1914,6 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
|
|||||||
|
|
||||||
if (rc == STAT_BOGUS || rc == STAT_NEED_KEY || rc == STAT_NEED_DS)
|
if (rc == STAT_BOGUS || rc == STAT_NEED_KEY || rc == STAT_NEED_DS)
|
||||||
{
|
{
|
||||||
/* Zone is insecure, don't need to validate RRset */
|
|
||||||
if (class)
|
if (class)
|
||||||
*class = class1; /* Class for NEED_DS or NEED_KEY */
|
*class = class1; /* Class for NEED_DS or NEED_KEY */
|
||||||
return rc;
|
return rc;
|
||||||
@@ -1966,7 +1973,7 @@ int dnssec_validate_reply(time_t now, struct dns_header *header, size_t plen, ch
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* OK, all the RRsets validate, now see if we have a missing answer or CNAME target. */
|
/* OK, all the RRsets validate, now see if we have a missing answer or CNAME target. */
|
||||||
if (check_unsigned)
|
if (secure == STAT_SECURE)
|
||||||
for (j = 0; j <targetidx; j++)
|
for (j = 0; j <targetidx; j++)
|
||||||
if ((p2 = targets[j]))
|
if ((p2 = targets[j]))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user