add nsec3 hashnames method
This commit is contained in:
parent
e628d15902
commit
003c8fd803
9
nsec3.go
9
nsec3.go
|
@ -12,7 +12,7 @@ type saltWireFmt struct {
|
|||
}
|
||||
|
||||
// Hash a string/label according to RFC5155
|
||||
func Nsec3Hash(label string, ha int, iterations int, salt string) string {
|
||||
func HashNames(label string, ha int, iterations int, salt string) string {
|
||||
saltwire := new(saltWireFmt)
|
||||
saltwire.Salt = salt
|
||||
wire := make([]byte, DefaultMsgSize)
|
||||
|
@ -48,3 +48,10 @@ func Nsec3Hash(label string, ha int, iterations int, salt string) string {
|
|||
}
|
||||
return unpackBase32(nsec3)
|
||||
}
|
||||
|
||||
// Hash the ownername and the next owner name in
|
||||
// an NSEC3 record, use the parameters from the NSEC3 itself.
|
||||
func (nsec3 *RR_NSEC3) HashNames() {
|
||||
nsec3.Header().Name = HashNames(nsec3.Header().Name, int(nsec3.Hash), int(nsec3.Iterations), nsec3.Salt)
|
||||
nsec3.NextDomain = HashNames(nsec3.NextDomain, int(nsec3.Hash), int(nsec3.Iterations), nsec3.Salt)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue