diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-08-17 17:19:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-17 17:19:06 -0700 |
commit | 96eab1202717e073782ec399a4e0820cae15b1bb (patch) | |
tree | 011012982be971c7e9ef91466f026bc0956ac9a2 /vendor/github.com/miekg/dns/tsig_test.go | |
parent | 2c895ee66eed626721135acfcc48254c6e3f3b29 (diff) | |
download | chat-96eab1202717e073782ec399a4e0820cae15b1bb.tar.gz chat-96eab1202717e073782ec399a4e0820cae15b1bb.tar.bz2 chat-96eab1202717e073782ec399a4e0820cae15b1bb.zip |
Updating server dependancies. (#7246)
Diffstat (limited to 'vendor/github.com/miekg/dns/tsig_test.go')
-rw-r--r-- | vendor/github.com/miekg/dns/tsig_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vendor/github.com/miekg/dns/tsig_test.go b/vendor/github.com/miekg/dns/tsig_test.go index 48b9988b6..4bc52733c 100644 --- a/vendor/github.com/miekg/dns/tsig_test.go +++ b/vendor/github.com/miekg/dns/tsig_test.go @@ -1,6 +1,7 @@ package dns import ( + "encoding/binary" "testing" "time" ) @@ -22,6 +23,20 @@ func TestTsig(t *testing.T) { if err != nil { t.Fatal(err) } + + // TSIG accounts for ID substitution. This means if the message ID is + // changed by a forwarder, we should still be able to verify the TSIG. + m = newTsig(HmacMD5) + buf, _, err = TsigGenerate(m, "pRZgBrBvI4NAHZYhxmhs/Q==", "", false) + if err != nil { + t.Fatal(err) + } + + binary.BigEndian.PutUint16(buf[0:2], uint16(42)) + err = TsigVerify(buf, "pRZgBrBvI4NAHZYhxmhs/Q==", "", false) + if err != nil { + t.Fatal(err) + } } func TestTsigCase(t *testing.T) { |