diff --git a/nsec3.go b/nsec3.go index 23b5f20e..21692418 100644 --- a/nsec3.go +++ b/nsec3.go @@ -11,8 +11,9 @@ type saltWireFmt struct { Salt string "size-hex" } -// Hash a string/label according to RFC5155. -func hashName(label string, ha int, iterations int, salt string) string { +// HashName hashes a string or label according to RFC5155. It returns +// the hashed string. +func HashName(label string, ha int, iterations int, salt string) string { saltwire := new(saltWireFmt) saltwire.Salt = salt wire := make([]byte, DefaultMsgSize) diff --git a/update.go b/update.go index cd47c72f..bcdc83bc 100644 --- a/update.go +++ b/update.go @@ -65,9 +65,9 @@ func (u *Update) NameNotUsed(rr []RR) { // RRsetUsedFull sets the RRs in the prereq section to // "RRset exists (value dependent -- with rdata)" RRs. RFC 2136 section 2.4.2. func (u *Update) RRsetUsedFull(rr []RR) { - if len(u.Msg.Question) == 0 { - panic("empty question section") - } + if len(u.Msg.Question) == 0 { + panic("empty question section") + } u.Answer = make([]RR, len(rr)) for i, r := range rr { u.Answer[i] = r @@ -110,9 +110,9 @@ func (u *Update) RRsetNotUsed(rr []RR) { // RRsetAddFull adds an complete RRset, see RFC 2136 section 2.5.1 func (u *Update) RRsetAddFull(rr []RR) { - if len(u.Msg.Question) == 0 { - panic("empty question section") - } + if len(u.Msg.Question) == 0 { + panic("empty question section") + } u.Ns = make([]RR, len(rr)) for i, r := range rr { u.Ns[i] = r