Logo
Explore Help
Sign In
Mirrors/coredns
1
0
Fork 0
You've already forked coredns
mirror of https://github.com/coredns/coredns.git synced 2025-10-28 08:44:17 -04:00
Code Issues Packages Projects Releases Wiki Activity
Files
9a528d92b10b1b2b12744a747852fcfb0343c431
coredns/plugin/sign/nsec_test.go

28 lines
510 B
Go
Raw Normal View History

plugin/sign: fix signing of authoritative data (#3479) Don't sign data we are not authoritative for. This adds an AuthWalk which skips names we should not authoritative for. Adds a few tests to check this is the case. Generates zones have been compared to dnssec-signzone. A number of changes have been made: * don't add DS records to the apex * NSEC TTL is the SOA's minttl value (copying bind9) * Various cleanups * signer struct was cleaned up: doesn't need ttl, nor expiration or inception. * plugin/sign: remove apex stuff from names() This is never used because we will always have other types in the apex, because we *ADD* them ourselves, before we sign (DNSKEY, CDS and CDNSKEY). Signed-off-by: Miek Gieben <miek@miek.nl> Co-Authored-By: Chris O'Haver <cohaver@infoblox.com>
2019-12-06 19:54:31 +00:00
package sign
import (
"os"
"testing"
"github.com/coredns/coredns/plugin/file"
)
func TestNames(t *testing.T) {
f, err := os.Open("testdata/db.miek.nl_ns")
if err != nil {
t.Error(err)
}
z, err := file.Parse(f, "db.miek.nl_ns", "miek.nl", 0)
if err != nil {
t.Error(err)
}
names := names("miek.nl.", z)
expected := []string{"miek.nl.", "child.miek.nl.", "www.miek.nl."}
for i := range names {
if names[i] != expected[i] {
t.Errorf("Expected %s, got %s", expected[i], names[i])
}
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.7 Page: 79ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API