Remove saltWireFmt from nsecx.go
This isn't really needed and doesn't make the code any clearer.
This commit is contained in:
parent
fa589750ad
commit
4058ac87fa
16
nsecx.go
16
nsecx.go
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue