File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,21 @@ bool dns_type_may_redirect(uint16_t type) {
120120 DNS_TYPE_KEY );
121121}
122122
123+ bool dns_type_may_wildcard (uint16_t type ) {
124+
125+ /* The following records may not be expanded from wildcard RRsets */
126+
127+ if (dns_type_is_pseudo (type ))
128+ return false;
129+
130+ return !IN_SET (type ,
131+ DNS_TYPE_NSEC3 ,
132+ DNS_TYPE_SOA ,
133+
134+ /* Prohibited by https://tools.ietf.org/html/rfc4592#section-4.4 */
135+ DNS_TYPE_DNAME );
136+ }
137+
123138bool dns_type_is_dnssec (uint16_t type ) {
124139 return IN_SET (type ,
125140 DNS_TYPE_DS ,
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ bool dns_type_is_valid_rr(uint16_t type);
131131bool dns_type_may_redirect (uint16_t type );
132132bool dns_type_is_dnssec (uint16_t type );
133133bool dns_type_is_obsolete (uint16_t type );
134+ bool dns_type_may_wildcard (uint16_t type );
134135
135136bool dns_class_is_pseudo (uint16_t class );
136137bool dns_class_is_valid_rr (uint16_t class );
Original file line number Diff line number Diff line change @@ -548,6 +548,11 @@ int dnssec_verify_rrset(
548548 r = dns_name_suffix (DNS_RESOURCE_KEY_NAME (key ), rrsig -> rrsig .labels , & source );
549549 if (r < 0 )
550550 return r ;
551+ if (r > 0 && !dns_type_may_wildcard (rrsig -> rrsig .type_covered )) {
552+ /* We refuse to validate NSEC3 or SOA RRs that are synthesized from wildcards */
553+ * result = DNSSEC_INVALID ;
554+ return 0 ;
555+ }
551556 if (r == 1 ) {
552557 /* If we stripped a single label, then let's see if that maybe was "*". If so, we are not really
553558 * synthesized from a wildcard, we are the wildcard itself. Treat that like a normal name. */
You can’t perform that action at this time.
0 commit comments