mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
resolved: don't conclude NODATA if CNAME exists
Instead introduce the new return-code DNSSEC_NSEC_CNAME to indicate this condition. See RFC 6840, Section 4.3.
This commit is contained in:
parent
964067666f
commit
146035b3bb
@ -1314,8 +1314,15 @@ found_closest_encloser:
|
||||
|
||||
if (!pp) {
|
||||
/* No next closer NSEC3 RR. That means there's a direct NSEC3 RR for our key. */
|
||||
*result = bitmap_isset(enclosure_rr->nsec3.types, key->type) ? DNSSEC_NSEC_FOUND : DNSSEC_NSEC_NODATA;
|
||||
if (bitmap_isset(enclosure_rr->nsec3.types, key->type))
|
||||
*result = DNSSEC_NSEC_FOUND;
|
||||
else if (bitmap_isset(enclosure_rr->nsec3.types, DNS_TYPE_CNAME))
|
||||
*result = DNSSEC_NSEC_CNAME;
|
||||
else
|
||||
*result = DNSSEC_NSEC_NODATA;
|
||||
|
||||
*authenticated = a;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1393,7 +1400,12 @@ int dnssec_test_nsec(DnsAnswer *answer, DnsResourceKey *key, DnssecNsecResult *r
|
||||
if (r < 0)
|
||||
return r;
|
||||
if (r > 0) {
|
||||
*result = bitmap_isset(rr->nsec.types, key->type) ? DNSSEC_NSEC_FOUND : DNSSEC_NSEC_NODATA;
|
||||
if (bitmap_isset(rr->nsec.types, key->type))
|
||||
*result = DNSSEC_NSEC_FOUND;
|
||||
else if (bitmap_isset(rr->nsec.types, DNS_TYPE_CNAME))
|
||||
*result = DNSSEC_NSEC_CNAME;
|
||||
else
|
||||
*result = DNSSEC_NSEC_NODATA;
|
||||
*authenticated = flags & DNS_ANSWER_AUTHENTICATED;
|
||||
return 0;
|
||||
}
|
||||
|
@ -91,6 +91,7 @@ int dnssec_nsec3_hash(DnsResourceRecord *nsec3, const char *name, void *ret);
|
||||
|
||||
typedef enum DnssecNsecResult {
|
||||
DNSSEC_NSEC_NO_RR, /* No suitable NSEC/NSEC3 RR found */
|
||||
DNSSEC_NSEC_CNAME, /* Would be NODATA, but for the existence of a CNAME RR */
|
||||
DNSSEC_NSEC_UNSUPPORTED_ALGORITHM,
|
||||
DNSSEC_NSEC_NXDOMAIN,
|
||||
DNSSEC_NSEC_NODATA,
|
||||
|
@ -2300,6 +2300,7 @@ int dns_transaction_validate_dnssec(DnsTransaction *t) {
|
||||
break;
|
||||
|
||||
case DNSSEC_NSEC_FOUND:
|
||||
case DNSSEC_NSEC_CNAME:
|
||||
/* NSEC says it needs to be there, but we couldn't find it? Bummer! */
|
||||
t->answer_dnssec_result = DNSSEC_NSEC_MISMATCH;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user