mirror of
https://github.com/coredns/coredns.git
synced 2025-11-02 02:03:13 -05:00
plugin/dnssec: fix blacklies for NXDOMAIN (#1399)
* plugin/dnssec: filter bitmap also for NXDOMAIN responses We change nxdomain to nodata, so at the point when we receive the reply it can be nxdomain or nodata. In both cases we should filter the nsec bitmap. Change the code and add explicit tests for this. * More tests
This commit is contained in:
@@ -38,10 +38,9 @@ var (
|
||||
apexBitmap = [...]uint16{dns.TypeA, dns.TypeNS, dns.TypeSOA, dns.TypeHINFO, dns.TypeMX, dns.TypeTXT, dns.TypeAAAA, dns.TypeLOC, dns.TypeSRV, dns.TypeCERT, dns.TypeSSHFP, dns.TypeRRSIG, dns.TypeNSEC, dns.TypeDNSKEY, dns.TypeTLSA, dns.TypeHIP, dns.TypeOPENPGPKEY, dns.TypeSPF}
|
||||
)
|
||||
|
||||
// filter14 filters out t from bitmap (if it exists). If mt is not an NODATA response, just
|
||||
// return the entire bitmap.
|
||||
// filter14 filters out t from bitmap (if it exists). If mt is not an NODATA response, just return the entire bitmap.
|
||||
func filter14(t uint16, bitmap [14]uint16, mt response.Type) []uint16 {
|
||||
if mt != response.NoData {
|
||||
if mt != response.NoData && mt != response.NameError {
|
||||
return zoneBitmap[:]
|
||||
}
|
||||
for i := range bitmap {
|
||||
@@ -53,7 +52,7 @@ func filter14(t uint16, bitmap [14]uint16, mt response.Type) []uint16 {
|
||||
}
|
||||
|
||||
func filter18(t uint16, bitmap [18]uint16, mt response.Type) []uint16 {
|
||||
if mt != response.NoData {
|
||||
if mt != response.NoData && mt != response.NameError {
|
||||
return apexBitmap[:]
|
||||
}
|
||||
for i := range bitmap {
|
||||
|
||||
Reference in New Issue
Block a user