Commit Graph

128 Commits

Author SHA1 Message Date
Miek Gieben 4bd038eb76
Run gofmt -w -s *.go (#1408)
Signed-off-by: Miek Gieben <miek@miek.nl>

Signed-off-by: Miek Gieben <miek@miek.nl>
2023-01-05 07:53:57 +01:00
Miek Gieben 69924a02cf
Make tsigGenerateProvider/TsigVerifyProvider public (#1382)
Make it public as TsigGenerateWithProvider and update the docs a little.
And TsigVerifyWithProvider also - tweak those docs also a little.

Signed-off-by: Miek Gieben <miek@miek.nl>
2022-06-21 10:37:36 +02:00
Tom Thorogood 33e64002b6
Support TsigProvider for Server and Transfer (#1331)
Automatically submitted.
2022-02-05 00:23:49 +00:00
Miek Gieben 711e0fd90d
doc: fix xfr example. (#1062)
* doc: fix xfr example.

The currently example code has a data race, put in the proper code.

Fixes: #1061

Signed-off-by: Miek Gieben <miek@miek.nl>

* Feedback

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-12-19 13:11:22 +00:00
Nick McKinney 77c7d907b4 Set TSIG on Transfer Out (#939)
* Call SetTsig() Msg `r` if q.IsTsig() != nil to enable TSIG on AXFR.

* Add tests for xfr.go

* Fix data race condition setting server.TsigSecret

* Test cleanup: xfr_test.go

* Xfr Test cleanup: use exported `IsDuplicate()`, len(xfrTestData)
2019-05-12 09:15:21 +01:00
Tom Thorogood 29b9bf368b Remove pointless casts (#895)
* Remove pointless casts

These are all casts where the value was already of the same type.

* Use var style for zero-value not cast style
2019-01-04 10:30:55 +00:00
Tom Thorogood 513c1ff221 Simplify and unify various returns (#893) 2019-01-04 10:19:42 +00:00
Tom Thorogood 34be74deeb Flatten goroutine inside goroutine in Transfer.In (#890)
* Flatten goroutine inside goroutine in Transfer.In

* Return an error for unknown question types

Previously this would just be silently ignored leaving nothing to close
the returned channel or return an error.
2019-01-04 08:14:40 +00:00
Matthijs Mekking 99c447f9f6 TSIG name must be presented in canonical form (#574)
* TSIG name must be presented in canonical form

Update the documentation to make clear that the zonename in the
TsigSecret map must be in canonical form.

* Reference RFC 4034 for canonical form
2017-11-17 13:17:47 +00:00
kahnert be519e51ff Fix IXFR may end prematurely (#512) (#507)
Fix make IXFR work with single line answers (#507)
2017-10-13 17:21:31 +02:00
Miek Gieben e78414ef75 xfr: return sane error when !RcodeSuccess (#496)
When the server returns a non succesful rcode, return that to the caller
in stead of the "bad soa" of before. "dns: bad xfr rcode: <RCODE>" is
now returned.

Fixes #467
2017-06-04 13:30:08 +01:00
Miek Gieben b4a9a147b2 Small fix in docs for transfer Out 2016-03-28 15:45:23 +01:00
Miek Gieben 273bc1d0ee Make err explicit and drop the deref on *master 2015-09-23 16:48:28 +01:00
TimSimmons 0eeb50cbb8 Allow supplying a Conn in Transfer struct
- This allows a user to call `Dial` before they call `Transfer.In`,
thus specifying the attributes of a [Dialer](https://golang.org/src/net/dial.go?s=5630:5708#L17)
before their AXFR
- Add some docs to Transfer.in to show the functionality

closes #264
2015-09-23 10:37:57 -05:00
Miek Gieben 114b68f41b go vet fixes 2015-08-23 07:24:08 +01:00
Flavien Lebarbe bc2101d0db Fix crash in inIxfr when ReadMsg fails
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x5dc851]

goroutine 41 [running]:
github.com/miekg/dns.(*Transfer).inIxfr(0xc2127648d0, 0x437bcc, 0xc21678c600)
        /mnt/data/xxxxx/third-party/src/github.com/miekg/dns/xfr.go:110 +0x231
created by github.com/miekg/dns.func·073
        /mnt/data/xxxxx/third-party/src/github.com/miekg/dns/xfr.go:45 +0xf5
2015-06-05 14:59:53 +02:00
Flavien Lebarbe 11bd0d5a09 Fix TSig check on second DNS message (TCP) #180
The next chunk needs to use the previous MAC
Using this fix, I can successfully verify the signatures of not
only the first but the subsequent envelopes as well.

Patch was proposed by andrewtj in a comment. Kudos !
2015-02-24 15:45:03 +01:00
StalkR fe160dfba4 minor clean ups: use time.Second instead of 1e9, do not reference ns as time.Duration is enough 2015-01-15 23:11:11 +01:00
StalkR 1d1dad9498 xfr: Transfer.Out use a new Msg every time 2015-01-15 13:07:26 +01:00
StalkR cf4c9a358e xfr: make Transfer.Out synchronous 2015-01-15 11:39:47 +01:00
Miek Gieben 0aa3021a83 Remove all copyright notices
Use the central COPYRIGHT file.
2014-09-11 20:57:37 +01:00
Miek Gieben e8919b372d added comment/todo 2014-06-04 10:21:27 +00:00
Miek Gieben 560a1c65b0 update license in pool.go
remove some build lines as I have no idea what they are
supposed to be doing.
2014-01-06 10:00:25 +00:00
Miek Gieben 7087f6a88c Also use Dial in xfr 2013-11-01 09:44:24 +00:00
Miek Gieben 76e7e3c9c4 fmt and documentation 2013-10-12 19:01:29 +01:00
Miek Gieben 68083bc956 Fix merge conflict from net branch 2013-10-12 17:59:46 +01:00
Miek Gieben 5b8fa0f1f6 Update the documentation 2013-10-12 16:26:25 +01:00
Miek Gieben 6dc58c11bd Fix outgoing axfr and make reflect use it. 2013-10-12 16:12:21 +01:00
Miek Gieben 675f170a3d Fix axfr tsig 2013-10-12 14:00:10 +01:00
Miek Gieben d0818e2321 Make q print number of envelopes when doing axfr 2013-10-12 13:27:03 +01:00
Miek Gieben 7691523300 Re-add ExchangeConn
ExchangeConn is back, but with a warning. Other various improvements.
2013-10-12 12:44:02 +01:00
Miek Gieben 3ca767d2eb Fix incoming axfr 2013-10-12 12:32:14 +01:00
Miek Gieben 77d78f3218 More xfr fixes, does not work yet 2013-10-11 22:34:04 +01:00
Miek Gieben 05e5e586b5 Fix xfr some more 2013-10-11 20:10:57 +01:00
Miek Gieben f9fa2d2c0c make these methods privates 2013-10-11 16:40:15 +00:00
Miek Gieben ca3c488ad8 Fix transfer 2013-10-11 16:36:37 +00:00
Miek Gieben b987dc6246 More transfer stuff 2013-10-11 16:18:37 +00:00
Miek Gieben 5868ba4cc8 Partial changes for xfr 2013-10-10 19:01:35 +00:00
Miek Gieben 403baeb73a Rework the transfers stuff 2013-10-02 20:35:13 +01:00
Eric Gavaletz de1a10559b Still more patching for GAE compatibility.
After removing some of the server files from the GAE build we hit
another undefined: ResponseWriter.
2013-10-02 11:56:56 -04:00
Miek Gieben 4bde528be5 Export dns.Conn and make it more like net.Conn
Export lowlevel function and types so that they may be used.
They higher level Exchange function is still there. ExchangeConn
is gone, because it is not needed.
2013-09-28 21:58:08 +01:00
Miek Gieben 31b43187fd add some doc and todo 2013-09-28 20:32:38 +01:00
Miek Gieben 2b6e9122bd Use the better name: SingleInflight 2013-09-06 09:49:07 +00:00
Pranay Kanwar 467e5fce1b Do not fail AXFR if first anwser is just SOA 2013-07-11 12:12:32 +05:30
Miek Gieben 81941d4422 Update all copyright notices 2013-05-12 16:15:52 +02:00
Miek Gieben d53d9eab81 gofmt 2013-05-05 20:30:44 +02:00
Miek Gieben 235e892dfc Rename the RR types drop the RR_ prefix
This is also done in the official Go library. It also make the
code shorter.
2012-12-09 19:23:25 +01:00
Miek Gieben d758825590 more documentation 2012-12-02 10:14:53 +01:00
Miek Gieben 7268c0f90a Rename the axfr stuff
Think the names are now more Go like and descriptive.
2012-12-02 09:01:23 +01:00
Miek Gieben 724a156794 Envelope is the correct term in the context of transfers 2012-12-02 08:47:32 +01:00