mirror of
https://github.com/miekg/dns.git
synced 2025-10-10 17:31:01 +02:00
more tweaks for tsig, it is broken now
This commit is contained in:
parent
e45b5679a6
commit
21020bc047
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user