Remove saltWireFmt from nsecx.go

This isn't really needed and doesn't make the code any clearer.
This commit is contained in:
Tom Thorogood 2018-11-29 10:24:25 +10:30
parent fa589750ad
commit 4058ac87fa
No known key found for this signature in database
GPG Key ID: 86C63CDA416C6D2F
1 changed files with 1 additions and 15 deletions

View File

@ -6,16 +6,10 @@ import (
"strings"
)
type saltWireFmt struct {
Salt string `dns:"size-hex"`
}
// HashName hashes a string (label) according to RFC 5155. It returns the hashed string in uppercase.
func HashName(label string, ha uint8, iter uint16, salt string) string {
saltwire := new(saltWireFmt)
saltwire.Salt = salt
wire := make([]byte, DefaultMsgSize)
n, err := packSaltWire(saltwire, wire)
n, err := packStringHex(salt, wire, 0)
if err != nil {
return ""
}
@ -98,11 +92,3 @@ func (rr *NSEC3) Match(name string) bool {
}
return false
}
func packSaltWire(sw *saltWireFmt, msg []byte) (int, error) {
off, err := packStringHex(sw.Salt, msg, 0)
if err != nil {
return off, err
}
return off, nil
}