Skip to content

Commit

Permalink
fixing #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo committed Dec 8, 2020
1 parent 7dc9f23 commit d357d16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion tools/rr_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,11 @@ func (ctx *Context) addNSEC3Records(optOut bool) error {
// Link the first one
nsec3List[len(nsec3List)-1].NextDomain = nsec3List[0].Hdr.Name
for i := 0; i < len(nsec3List); i++ {
nsec3List[i].Header().Name += "." + ctx.Config.Zone
if ctx.Config.Zone != "." {
nsec3List[i].Header().Name += "." + ctx.Config.Zone
} else {
nsec3List[i].Header().Name += ctx.Config.Zone
}
ctx.rrs = append(ctx.rrs, nsec3List[i])
}
}
Expand Down
6 changes: 3 additions & 3 deletions tools/sign_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func Sign(session SignSession) (ds *dns.DS, err error) {
ctx.Log.Printf("[Signature %d/%d] Creating RRSig for RRSet %s", i+1, len(rrSet)+1, v.String())
err = rrSig.Sign(keys.zskSigner, v)
if err != nil {
err = fmt.Errorf("cannot sign RRSig: %s", err)
err = fmt.Errorf("cannot create RRSig: %s", err)
if try == numTries {
return
}
Expand All @@ -96,7 +96,7 @@ func Sign(session SignSession) (ds *dns.DS, err error) {
ctx.Log.Printf("[Signature %d/%d] Verifying RRSig for RRSet %s\n", i+1, len(rrSet)+1, v.String())
err = rrSig.Verify(zsk, v)
if err != nil {
err = fmt.Errorf("cannot check RRSig: %s", err)
err = fmt.Errorf("RRSig does not validate: %s", err)
if try == numTries {
return
}
Expand Down Expand Up @@ -146,7 +146,7 @@ func Sign(session SignSession) (ds *dns.DS, err error) {
ctx.Log.Printf("Signing new zone digest...")
err = rrSig.Sign(keys.zskSigner, []dns.RR{ctx.zonemd})
if err != nil {
err = fmt.Errorf("cannot sign RRSig: %s", err)
err = fmt.Errorf("cannot create RRSig: %s", err)
return nil, err
}
ctx.Log.Printf("Verifying new zone digest...")
Expand Down

0 comments on commit d357d16

Please sign in to comment.