forked from TrueCloudLab/lego
rfc2136: fix TSIG secret (#1633)
This commit is contained in:
parent
3694559777
commit
5228f6dbcf
2 changed files with 6 additions and 3 deletions
2
Makefile
2
Makefile
|
@ -20,7 +20,7 @@ clean:
|
||||||
|
|
||||||
build: clean
|
build: clean
|
||||||
@echo Version: $(VERSION)
|
@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:
|
image:
|
||||||
@echo Version: $(VERSION)
|
@echo Version: $(VERSION)
|
||||||
|
|
|
@ -180,10 +180,13 @@ func (d *DNSProvider) changeRecord(action, fqdn, value string, ttl int) error {
|
||||||
|
|
||||||
// TSIG authentication / msg signing
|
// TSIG authentication / msg signing
|
||||||
if len(d.config.TSIGKey) > 0 && len(d.config.TSIGSecret) > 0 {
|
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)
|
alg := dns.Fqdn(d.config.TSIGAlgorithm)
|
||||||
m.SetTsig(key, alg, 300, time.Now().Unix())
|
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
|
// Send the query
|
||||||
|
|
Loading…
Reference in a new issue