Add tsig support

This commit is contained in:
Miek Gieben 2012-03-04 17:54:14 +01:00
parent 4f7000d1f6
commit 58a0addc8a
2 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,8 @@ Must of the stuff is working, but there is a list of smaller things that
need to be fixed.
* Speed, we can always go faster. A simple reflect server now hits 35/45K qps
* Find a way to implement tsig and/or ip blocking for queries and transfers
this must work on the client side and in the server side
* go test; only works correct on my machine
* Add handy zone data structure (r/b tree)? Or not...
* Query source address?

View File

@ -11,7 +11,7 @@ import (
func main() {
serial := flag.Int("serial", 0, "Perform an IXFR with the given serial")
nameserver := flag.String("ns", "127.0.0.1:53", "Query this nameserver")
tsig := flag.String("tsig", "", "request tsig with key: name:key (only hmac-sha1)")
tsig := flag.String("tsig", "", "request tsig with key: name:key (only hmac-md5)")
flag.Parse()
zone := flag.Arg(flag.NArg() - 1)
@ -27,7 +27,7 @@ func main() {
a := strings.SplitN(*tsig, ":", 2)
name, secret := a[0], a[1]
client.TsigSecret = map[string]string{name: secret}
m.SetTsig(name, dns.HmacSHA1, 300, time.Now().Unix())
m.SetTsig(name, dns.HmacMD5, 300, time.Now().Unix())
}
if err := client.XfrReceive(m, *nameserver); err == nil {