Skip to content

Commit

Permalink
fixing bug with new glue array
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo committed Dec 23, 2020
1 parent 2c90ab7 commit 489de21
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
7 changes: 7 additions & 0 deletions tools/constants_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package tools_test

// Using default softHSM configuration. Change it if necessary.
const p11Lib = "/usr/lib/softhsm/libsofthsm2.so" // Path used by Ubuntu Bionic Beaver
const p11Key = "1234"
const p11LabelRSA = "test-hsm-rsa"
const p11LabelECDSA = "test-hsm-ecdsa"
4 changes: 3 additions & 1 deletion tools/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func NewContext(config *ContextConfig, log *log.Logger) (ctx *Context, err error
Config: config,
Log: log,
SignAlgorithm: algorithm,
Glue: make(map[string]struct{}),
}

if len(config.FilePath) > 0 {
Expand Down Expand Up @@ -89,6 +88,9 @@ func (ctx *Context) ReadAndParseZone(updateSerial bool) error {
if ctx.File == nil {
return fmt.Errorf("no file defined on context")
}
if ctx.Glue == nil {
ctx.Glue = make(map[string]struct{})
}

rrs := make(RRArray, 0)

Expand Down
6 changes: 0 additions & 6 deletions tools/pkcs11_signer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ import (
"github.com/niclabs/dns-tools/tools"
)

// Using default softHSM configuration. Change it if necessary.
const p11Lib = "/usr/lib/softhsm/libsofthsm2.so" // Path used by Ubuntu Bionic Beaver
const p11Key = "1234"
const p11LabelRSA = "test-hsm-rsa"
const p11LabelECDSA = "test-hsm-ecdsa"

func TestSession_PKCS11RSASign(t *testing.T) {
ctx := &tools.Context{
Config: &tools.ContextConfig{
Expand Down
8 changes: 2 additions & 6 deletions tools/rr_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,8 @@ func (ctx *Context) addNSEC3Records() error {
if typeMap[dns.TypeSOA] {
typeMap[dns.TypeNSEC3PARAM] = true
}
if !typeMap[dns.TypeDS] && !typeMap[dns.TypeDNSKEY] {
if ctx.Config.OptOut {
continue
} else {
ctx.Log.Printf("opt-out is not set and owner name %s has not a DS RR", rrSet[0].Header().Name)
}
if !typeMap[dns.TypeDS] && !typeMap[dns.TypeDNSKEY] && ctx.Config.OptOut {
continue
}
// Add current NSEC3 RR
err := nsec3list.add(rrSet[0].Header().Name, param, typeMap)
Expand Down

0 comments on commit 489de21

Please sign in to comment.