AXFRDDNS: Canonicalize key name as per RFC 2845 3.4.2 (#2966)

This commit is contained in:
nemunaire 2024-05-29 20:37:18 +00:00 committed by GitHub
parent 1f4c4c65f5
commit b3787ab8f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -216,10 +216,7 @@ func readKey(raw string, kind string) (*Key, error) {
if err != nil {
return nil, fmt.Errorf("cannot decode Base64 secret (%s) in AXFRDDNS.TSIG", kind)
}
id := arr[1]
if !strings.HasSuffix(id, ".") {
id += "."
}
id := dns.CanonicalName(arr[1])
return &Key{algo: algo, id: id, secret: arr[2]}, nil
}