From 32b8863a93225a3c773011b6a8c4bdca271b8e35 Mon Sep 17 00:00:00 2001 From: halochou Date: Tue, 27 Feb 2024 16:59:37 -0500 Subject: [PATCH] AXFRDDNS: Avoid appending dot if TSIG key ID already has a dot suffix (#2855) Co-authored-by: Yang Zhou --- providers/axfrddns/axfrddnsProvider.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/providers/axfrddns/axfrddnsProvider.go b/providers/axfrddns/axfrddnsProvider.go index fabeb6a4d..e05bd4415 100644 --- a/providers/axfrddns/axfrddnsProvider.go +++ b/providers/axfrddns/axfrddnsProvider.go @@ -212,7 +212,11 @@ func readKey(raw string, kind string) (*Key, error) { if err != nil { return nil, fmt.Errorf("cannot decode Base64 secret (%s) in AXFRDDNS.TSIG", kind) } - return &Key{algo: algo, id: arr[1] + ".", secret: arr[2]}, nil + id := arr[1] + if !strings.HasSuffix(id, ".") { + id += "." + } + return &Key{algo: algo, id: id, secret: arr[2]}, nil } // GetNameservers returns the nameservers for a domain.