more tweaks for tsig, it is broken now

This commit is contained in:
Miek Gieben 2011-04-19 11:36:30 +02:00
parent e45b5679a6
commit 21020bc047

View File

@ -247,6 +247,7 @@ func (w *reply) Receive() (*Msg, os.Error) {
} }
// Tsig // Tsig
if m.IsTsig() { if m.IsTsig() {
println("DOING TSIG")
secret := m.Extra[len(m.Extra)-1].(*RR_TSIG).Hdr.Name secret := m.Extra[len(m.Extra)-1].(*RR_TSIG).Hdr.Name
_, ok := w.Client().TsigSecret[secret] _, ok := w.Client().TsigSecret[secret]
if !ok { if !ok {
@ -254,7 +255,10 @@ func (w *reply) Receive() (*Msg, os.Error) {
} }
ok, err := TsigVerify(p, w.Client().TsigSecret[secret], w.tsigTimersOnly) ok, err := TsigVerify(p, w.Client().TsigSecret[secret], w.tsigTimersOnly)
if !ok { if !ok {
println("TSIG DID NOT VALIDATED")
return m, err return m, err
} else {
println("TSIG VALIDATED")
} }
} }
return m, nil return m, nil