diff --git a/types.go b/types.go index 1e826cbe..8cc9306f 100644 --- a/types.go +++ b/types.go @@ -1541,7 +1541,7 @@ func (rr *CAA) len() int { return rr.Hdr.len() + 1 + len(rr.Tag) + len func (rr *CAA) String() string { s := rr.Hdr.String() - s += "\\# " + strconv.Itoa(2 + len(rr.Tag) + len(rr.Value)) + " " + s += "\\# " + strconv.Itoa(2 + len(rr.Tag) + len(rr.Value)/2) + " " s += fmt.Sprintf("%02X%02X%X%s", rr.Flag, len(rr.Tag), rr.Tag, strings.ToUpper(rr.Value)) return s } diff --git a/zscan_rr.go b/zscan_rr.go index 8b3f3dfe..87a657ea 100644 --- a/zscan_rr.go +++ b/zscan_rr.go @@ -2208,12 +2208,14 @@ func setCAA(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) { return nil, &ParseError{f, "bad CAA Tag length", l}, "" } - tag, e := hex.DecodeString(s[4:4+taglength]) + tag, e := hex.DecodeString(s[4:4+(taglength*2)]) if e != nil { return nil, &ParseError{f, "bad CAA Tag", l}, "" } rr.Tag = string(tag) + rr.Value = s[4+(taglength*2):] + return rr, nil, c1 }