Skip to content

.toCAA() doesn't handle CAA-values with spaces #178

@NicolaiSoeborg

Description

@NicolaiSoeborg

For fancy CAA records, e.g. ACME-CAA the parsing logic in .toCAA doesn't handle "CAA-value" data that contains spaces (but quoted)

libdns/record.go

Lines 157 to 165 in 6be5766

func (r RR) toCAA() (CAA, error) {
if expectedType := "CAA"; r.Type != expectedType {
return CAA{}, fmt.Errorf("record type not %s: %s", expectedType, r.Type)
}
fields := strings.Fields(r.Data)
if expectedLen := 3; len(fields) != expectedLen {
return CAA{}, fmt.Errorf(`malformed CAA value; expected %d fields in the form 'flags tag "value"'`, expectedLen)
}

Example CAA record failing: 128 issue "letsencrypt.org; accounturi=..."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions