1
0
mirror of https://github.com/go-acme/lego.git synced 2024-12-22 16:53:17 +02:00

rfc2136: fix TSIG secret (#1633)

This commit is contained in:
Ludovic Fernandez 2022-04-27 17:46:39 +02:00 committed by GitHub
parent 3694559777
commit 5228f6dbcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -20,7 +20,7 @@ clean:
build: clean
@echo Version: $(VERSION)
go build -v -trimpath -ldflags '-X "main.version=${VERSION}"' -o ${BIN_OUTPUT} ${MAIN_DIRECTORY}
go build -trimpath -ldflags '-X "main.version=${VERSION}"' -o ${BIN_OUTPUT} ${MAIN_DIRECTORY}
image:
@echo Version: $(VERSION)

View File

@ -180,10 +180,13 @@ func (d *DNSProvider) changeRecord(action, fqdn, value string, ttl int) error {
// TSIG authentication / msg signing
if len(d.config.TSIGKey) > 0 && len(d.config.TSIGSecret) > 0 {
key := dns.Fqdn(d.config.TSIGKey)
key := strings.ToLower(dns.Fqdn(d.config.TSIGKey))
alg := dns.Fqdn(d.config.TSIGAlgorithm)
m.SetTsig(key, alg, 300, time.Now().Unix())
c.TsigSecret = map[string]string{dns.Fqdn(d.config.TSIGKey): d.config.TSIGSecret}
// secret(s) for Tsig map[<zonename>]<base64 secret>,
// zonename must be in canonical form (lowercase, fqdn, see RFC 4034 Section 6.2)
c.TsigSecret = map[string]string{key: d.config.TSIGSecret}
}
// Send the query