Commit Graph

4104 Commits

Author SHA1 Message Date
Miek Gieben 2acbc9eff3 Release 1.1.17 2019-09-10 07:44:47 +01:00
Miek Gieben dcb849b337
update deps (#1005)
Update the deps to the latest versions.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-09-09 14:34:25 +01:00
Miek Gieben c674456565 Release 1.1.16 2019-08-17 16:39:23 +01:00
Tiago Ilieve 5825da9f4d Migrate to Go modules (#980)
* Remove 'vendor/' directory

* Remove Go dep, add Go modules

* Travis: remove Go 1.10/GOPATH, add Go modules
2019-08-17 15:38:20 +00:00
Miek Gieben b13675009d Release 1.1.15 2019-06-28 16:40:26 +01:00
Tom Thorogood 7f2bf8764a Set the TC bit more aggressively in Truncate (#989)
* Set the TC bit more aggressively in Truncate

* Update Truncate documentation for TC bit changes
2019-06-24 16:59:43 +01:00
chantra d89f1e3d4b Reply with NOTIMPL when Opcode is not supported (#982)
One of the test from DNS Compliance testing validates that if the opcode
is not supported, a NOTIMPL rcode is returned.

e0884144dd/genreport.c (L293)

This diff makes the default acceptfunc support this case and reply with
NOTIMPL instead of FORMERR.
2019-06-17 16:13:02 +01:00
chantra ee62c8b086 go fmt (#986) 2019-06-13 07:24:10 +01:00
Miek Gieben 9cfcfb2209 Release 1.1.14 2019-06-10 07:39:39 +01:00
Tom Thorogood 25cacca8ca Prohibit newlines before record data in the ZoneParser (#979)
* Merge setRR into ZoneParser.Next

* Remove file argument from RR.parse

This was only used to fill in the ParseError file field. Instead we now
fill in that field in ZoneParser.Next.

* Move dynamic update check out of RR.parse

This consolidates all the dynamic update checks into one place.

* Check for unexpected newline before parsing RR data

* Move rr.parse call into if-statement

* Allow dynamic updates for TKEY and RFC3597 records

* Document that ParseError file field is unset from parse

* Inline allowDynamicUpdate into ZoneParser.Next

* Improve and simplify TestUnexpectedNewline
2019-06-10 07:38:54 +01:00
Frank Olbricht cbc52d2408 Add github.com/folbricht/routedns to users list (#984) 2019-06-10 07:35:38 +01:00
Miek Gieben 8a56deec68
Update deps (#981)
* update deps

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-06-06 07:36:43 +01:00
Miek Gieben d16ecb693e Release 1.1.13 2019-05-27 15:48:50 +01:00
Yaroslav Kolomiiets 1545072057 ignore Z flag in queries, clear Z flag in automatic replies (#976) 2019-05-23 20:54:24 +01:00
Pepijnvi fbd426fefa Handle all net.Conn connections correctly (#957)
* Change switch to if condition

* Update switch to if in read function
2019-05-22 14:38:57 +01:00
Miek Gieben a2c73fb86d Release 1.1.12 2019-05-21 09:42:26 +01:00
chantra ccd41ffaf8 [nsec3] fix crash in nsec3 packing (#973)
Both NSEC and NSEC3 use the same logic to pack the bitmap.
CSYNC.pack also appear to make use of `packDataNsec` so I am giving it
the same treatment by moving the logic in a helper function and making
all those types `len` call use that function.
2019-05-21 07:27:24 +01:00
Miek Gieben 77cba59d63 Release 1.1.11 2019-05-20 20:49:47 +01:00
Miek Gieben 9c315c51c3
Remove DSA* algorithms (#972)
This follows BIND9 and removed support for the DSA family of algorithms.
Any DNSSEC implementation should consider those zones using it,
insecure.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-20 20:49:02 +01:00
Miek Gieben 087e486609
Run gofmt -w -s (#971)
mechanical run of gofmt.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-20 07:44:53 +01:00
Miek Gieben 0930b62a13
DNSSEC: remove deprecated algorithms (RFC 6944) (#970)
This removes RSAMD5 as an algorithm you can use. BIND also has
deprecated *all* DSA algos which is more involved can removes more
helper codes as well, so that should be done in a new PR.

See #968

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-20 07:44:43 +01:00
Miek Gieben d49318b5a0 Release 1.1.10 2019-05-19 08:40:58 +01:00
chantra 37f455fa04 [nsec] compute NSEC.len() the same way that we would do in packDataNsec (#967)
The byte sequence, when Unpack()-ed and subsequential Pack()-ed created a
panic: runtime error: slice bounds out of range
github.com/miekg/dns.(*Msg).packBufferWithCompressionMap(0xc0000d4000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x100, 0x14, 0x14e80b, 0xbf2d4654d501a3c8, ...)
/Users/chantra/go/src/github.com/miekg/dns/msg.go:868 +0x13a8

Confirmed that Unpacking/Repacking payload described in TestCrashNSEC
did not raise a slice bound out of range panic, added unittests which
failed prior to this change.

```
go test -run TestCrashNSEC
--- FAIL: TestCrashNSEC (0.00s)
    types_test.go:135: expected length of 19, got 12
FAIL
exit status 1
FAIL	github.com/miekg/dns	0.067s
```
2019-05-19 08:40:22 +01:00
chantra 2f1ea90356 packDataOpt: fix overflow in packing opt (#966)
An option needs a minimum of 4 bytes that contains OPTION-CODE and OPTION-LENGTH
The code was checkign off + 3 > len(msg) instead of off + 4
2019-05-18 18:23:50 +01: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
Miek Gieben 59b8e6b3db
Remove the word Scrub (#961)
The function is called Truncate, not Scrub (that was the old name).
Updated the function's documentation to rename this.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-03 08:25:00 +01:00
Tom Thorogood 92185d1e17 Simplify PrivateRR copying (#960)
This eliminates mkPrivateRR and reduces the risk of panic.
2019-04-30 09:14:58 +01:00
Tom Thorogood 56c04f1fec Fix dns:"hex" field len being off-by-one (#959)
dns:"hex" fields are not packed with any extra trailing byte. This was
causing a mismatch between PackRR and Len.
2019-04-30 09:14:07 +01:00
Miek Gieben 8aa92d4e02 Release 1.1.9 2019-04-30 07:24:24 +01:00
Tom Thorogood 357af3038a Always return UDP buffers to pool (#958) 2019-04-30 07:12:45 +01:00
Tom Thorogood cfee849963 Change the single in flight key for Client.Exchange (#943)
Previously it was possible for two different questions to hit the same
single in flight entry if the type or class isn't in the relevant
XToString map. This could happen for a proxy server or similar.
2019-04-10 11:55:21 +01:00
Miek Gieben 73601d4aed Release 1.1.8 2019-03-31 09:30:53 +01:00
Miek Gieben 0460860e89 Merge branch 'master' of github.com:miekg/dns 2019-03-31 09:30:33 +01:00
Miek Gieben 19b4ba9c16 Release 1.1.7 2019-03-31 08:50:54 +01:00
Tom Thorogood d1c1f95f67 Fix Len(rr) for dynamic update for A/AAAA/L32 RRs (#951) 2019-03-28 21:53:54 +00:00
Tom Thorogood d051b464e9 Add a message truncation implementation (#854)
* Add a message truncation implementation

* Remove OPT if-statement at end of Scrub

* Impose RFC 6891 payload size limit in Scrub

* Remove *Msg receiver from truncateLoop

* Remove OPT record creation from Scrub

* Test that TestRequestScrubAnswerExact has correct record count

* Rename (*Msg).Scrub to Truncate

This better reflects it's purpose.

* Remove comment reference to scrubbing in Truncate

* Properly calculate the length of OPT record in Truncate

* Correct comment in IsEdns0 in regards to RFC 6891

* Handle the OPT record being anywhere in Truncate

* Slight cleanup of Msg.Truncate
2019-03-24 09:20:11 +00:00
Tom Thorogood d8ff986484 Use for range loops instead of manual for loops (#937)
* Use for range loops instead of manual loops

* Use for range loop in Msg.CopyTo

This is a separate commit as the change is slightly more than just
switching the loop style.

* Use for range loop in DNSKEY.publicKeyRSA

* Add explen comment to DNSKEY.publicKeyRSA
2019-03-18 07:06:44 +00:00
Tom Thorogood bc7d5a495c Remove pointless cast in Conn.Read (#942)
This was accidentally added in a recent PR.
2019-03-18 07:01:10 +00:00
Tom Thorogood 1f99ca2fa4 Use new(big.Int) instead of big.NewInt(0) (#938)
* Use new(big.Int) instead of big.NewInt(0)

* Make big.NewInt(1) global for DNSKEY.PrivateKeyString
2019-03-13 07:36:34 +00:00
Christoffer Fjellström d49c86087e Add checks on data length for A and AAAA records (#919)
* Add checks on data length for A and AAAA records

Fixes panic when parsing A or AAAA records with no data

* Add tests Field() on empty A/AAAA data

* Refactor format test

* Add return value check on format test
2019-03-12 16:31:33 +00:00
Miek Gieben cc8cd02140 Release 1.1.6 2019-03-11 11:04:46 +00:00
Tom Thorogood 834f456fff Simplify TCP reading (#935)
* Simplify Server.readTCP

This slightly alters the error behaviour, but it should not be
observable outside of a decorated reader. I don't believe the old
behaviour was either obvious, documented or correct.

* Simplify TCP reading in client Conn

This alters the error behaviour in possibly observable ways, though
this is quite subtle and may not actually be readily observable.

Conn.ReadMsgHeader should behave the same way and still returns
ErrShortRead for length being too short.

Conn.Read will no longer return ErrShortRead if the length == 0,
otherwise it should be largely similar.

* Remove redundant error check in Conn.ReadMsgHeader
2019-03-11 10:59:25 +00:00
Tom Thorogood 337216f9a7 Use net.Buffers for writing TCP message (#934) 2019-03-10 13:46:14 +00:00
Tom Thorogood 1a5555c783 Split Server.serve into separate TCP and UDP methods (#933)
* Split Server.serve into separate TCP and UDP methods

* Merge reject cases in Server.serveDNS

* Inline Server.disposeBuffer method
2019-03-10 12:52:08 +00:00
Tom Thorogood 53b8a87e14 Correct Close() check in Server.serve (#932)
This was changed in ec3443f85d, but I
missed this function. Apparently no one noticed.
2019-03-10 11:59:36 +00:00
Miek Gieben eef2495fa3
Move srv.Handling selection to init() (#931)
Move this code to the server's init function to get it out of the
hotpath.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-10 11:14:57 +00:00
Miek Gieben 035891ab61 Release 1.1.5 2019-03-09 15:15:13 +00:00
Miek Gieben 284bad20d8
Manually revert go workers (98a1ef45) (#928)
Manually revert the worker model.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-09 13:34:22 +00:00
Tom F 487e4636d5 ZoneParser: error on parsing an IPv6 address in an A record (#923)
* ZoneParser: error on parsing an IPv6 address in an A record

And vice versa for IPv4 with AAAA.

The implementation of isIPv6 is inspired by e341bae08d/src/net/ip.go (L678-L681) .

* Fix benchmarks that try to use ::1 as A record.

* Test A/AAAA parsing via NewRR rather than zone parser.

* Document why we distinguish IPv4 vs IPv6 via existence of ":".
2019-03-09 09:02:18 +00:00
JINMEI Tatuya e838e1e3ce corrected default value of Server.MsgAcceptFunc as documented (#920)
the description says DefaultMsgAcceptFunc but actually defaultMsgAcceptFunc
was used.
2019-03-07 07:02:29 +00:00