From 675f170a3d351687182b14cd4ee0a999a24a451f Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sat, 12 Oct 2013 14:00:10 +0100 Subject: [PATCH] Fix axfr tsig --- client_test.go | 8 +++----- dns_test.go | 3 --- xfr.go | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/client_test.go b/client_test.go index 12430449..4e5b8762 100644 --- a/client_test.go +++ b/client_test.go @@ -79,17 +79,15 @@ Loop: } } -/* func TestClientTsigAXFR(t *testing.T) { m := new(Msg) m.SetAxfr("miek.nl.") m.SetTsig("axfr.", HmacMD5, 300, time.Now().Unix()) - c := new(Client) - c.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} - c.Net = "tcp" + tr := new(Transfer) + tr.TsigSecret = map[string]string{"axfr.": "so6ZGir4GPAqINNh9U5c3A=="} - if a, err := c.TransferIn(m, "37.251.95.53:53"); err != nil { + if a, err := tr.n(m, "176.58.119.54:53"); err != nil { t.Log("Failed to setup axfr: " + err.Error()) t.Fatal() } else { diff --git a/dns_test.go b/dns_test.go index 94b5bae1..aa208a99 100644 --- a/dns_test.go +++ b/dns_test.go @@ -9,9 +9,6 @@ import ( "testing" ) -// Query with way to long name -//./q mx bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.bla.miek.nl.miek.nl.miek123.nl. - func TestPackUnpack(t *testing.T) { out := new(Msg) out.Answer = make([]RR, 1) diff --git a/xfr.go b/xfr.go index ce78c5c9..a7c53dc3 100644 --- a/xfr.go +++ b/xfr.go @@ -20,6 +20,7 @@ type Transfer struct { DialTimeout time.Duration // net.DialTimeout (ns), defaults to 2 * 1e9 ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections (ns), defaults to 2 * 1e9 WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections (ns), defaults to 2 * 1e9 + TsigSecret map[string]string // Secret(s) for Tsig map[], zonename must be fully qualified tsigTimersOnly bool } @@ -70,7 +71,6 @@ func (t *Transfer) inAxfr(id uint16, c chan *Envelope) { c <- &Envelope{in.Answer, ErrId} return } - println("ok") if first { if !isSOAFirst(in) { c <- &Envelope{in.Answer, ErrSoa}