... and in the tests too

This commit is contained in:
Miek Gieben 2013-12-25 20:09:22 +00:00
parent 0c252cfd17
commit 2c460e62ed
2 changed files with 8 additions and 5 deletions

View File

@ -113,7 +113,7 @@ func (rr *NSEC3) Match(name string) bool {
}
// VerifyNameError takes a slice of NSEC or NSEC3 RR, the qname and the qtype and tries
// to proof the authenticated denial of existence. If nil is returned the proof
// to verify the authenticated denial of existence. If nil is returned the proof
// succeeded otherwise the error will indicated what was wrong.
func VerifyNameError(nsecx []RR, qname string, qtype uint16) error {
// TODO(miek): wildcard expanded reply
@ -177,3 +177,6 @@ ClosestEncloser:
// NSEC Helper
func verifyNameError(nsecx []RR, qname string, qtype uint16) error { return nil }
// VerifyNoData
func VerifyNoData(nsecx []RR, qname string, qtype uint16) error { return nil}

View File

@ -48,7 +48,7 @@ func TestNsec3Proof(t *testing.T) {
newNSEC3("39p91242oslggest5e6a7cci4iaeqvnk.nl. IN NSEC3 1 1 5 F10E9F7EA83FC8F3 39P99DCGG0MDLARTCRMCF6OFLLUL7PR6 NS DS RRSIG"),
newNSEC3("t98kg1p1cjtdoc4ksb7g57jc9vulltcd.nl. IN NSEC3 1 1 5 F10E9F7EA83FC8F3 T98MULSKU3E499AGCTTRJK6H0L3E5T92 NS DS RRSIG")}
err := Proof(nsec3, "snasajsksasasa.nl.", TypeA)
err := VerifyNameError(nsec3, "snasajsksasasa.nl.", TypeA)
if err != nil {
t.Logf("Failed to validate NSEC3")
t.Fail()
@ -58,7 +58,7 @@ func TestNsec3Proof(t *testing.T) {
newNSEC3("39p91242oslggest5e6a7cci4iaeqvnk.nl. IN NSEC3 1 1 5 F10E9F7EA83FC8F3 39P99DCGG0MDLARTCRMCF6OFLLUL7PR6 NS DS RRSIG"),
newNSEC3("t98kg1p1cjtdoc4ksb7g57jc9vulltcd.nl. IN NSEC3 1 1 5 F10E9F7EA83FC8F3 T98MULSKU3E499AGCTTRJK6H0L3E5T92 NS DS RRSIG")}
err = Proof(nsec3, "snasajsksasasa.nl.", TypeA)
err = VerifyNameError(nsec3, "snasajsksasasa.nl.", TypeA)
if err == nil {
t.Logf("Should fail validate NSEC3")
t.Fail()
@ -68,7 +68,7 @@ func TestNsec3Proof(t *testing.T) {
newNSEC3("39p91242oslggest5e6a7cci4iaeqvnk.nl. IN NSEC3 1 1 5 F10E9F7EA83FC8F3 39P99DCGG0MDLARTCRMCF6OFLLUL7PR6 NS DS RRSIG"),
newNSEC3("t98kg1p1cjtdoc4ksb7g57jc9vulltcd.nl. IN NSEC3 1 1 5 F10E9F7EA83FC8F3 T98LULSKU3E499AGCTTRJK6H0L3E5T92 NS DS RRSIG")}
err = Proof(nsec3, "snasajsksasasa.nl.", TypeA)
err = VerifyNameError(nsec3, "snasajsksasasa.nl.", TypeA)
if err == nil {
t.Logf("Should fail validate NSEC3")
t.Fail()
@ -78,7 +78,7 @@ func TestNsec3Proof(t *testing.T) {
newNSEC3("39p91242oslggest5e6a7cci4iaeqvnk.nl. IN NSEC3 1 1 5 F10E9F7EA83FC8F3 39P89DCGG0MDLARTCRMCF6OFLLUL7PR6 NS DS RRSIG"),
newNSEC3("t98kg1p1cjtdoc4ksb7g57jc9vulltcd.nl. IN NSEC3 1 1 5 F10E9F7EA83FC8F3 T98LULSKU3E499AGCTTRJK6H0L3E5T92 NS DS RRSIG")}
err = Proof(nsec3, "snasajsksasasa.nl.", TypeA)
err = VerifyNameError(nsec3, "snasajsksasasa.nl.", TypeA)
if err == nil {
t.Logf("Should fail validate NSEC3")
t.Fail()