Commit Graph

4104 Commits

Author SHA1 Message Date
Miek Gieben 996478ee91 Release 1.1.43 2021-06-22 14:03:06 +02:00
Miek Gieben bd70190c4d
Move makeDataOpt into edns.go (#1273)
Make it more obvious that these two lists (const, and case) need to be
in sync.

Also sort the list to match the const sorting.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-06-22 14:00:25 +02:00
Malte Granderath 595ee5aa98
Adding TCPKeepAlive to makeDataOpt (#1272) 2021-06-22 09:41:30 +02:00
Miek Gieben ce48a4b9ef
small cleans from go report card (#1268)
I went through the list and cleaned things up here and there.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-06-17 11:05:49 +02:00
joseph-stanton-ax 9922549621
Incorrect HIP RR public key length decode (#1262)
When decoding a HIP resource record, 'base64.StdEncoding.DecodedLen' can return a length larger than the length of the decoded public key. This change decodes the public key and retrieves the correct length. In our tests, the public key length was being set to 33, instead of 32. Below is our offending resource record:
'23b5993f649c0827.a.b.c.      3600    IN      HIP     5 200100100020001523B5993F649C0827 Cm6k4jhir9YYoKq9JDqD3Ob1hBfCuwbWam1igFPhkGg='
2021-05-13 09:33:12 +02:00
Miek Gieben d2b5d38d4f
Remove cifuzz (#1260)
The existing of the file signifies it needs to run, so now it errors
that there is nothing to run (everything is commented out).

Remove the entire file.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-05-10 09:32:16 +02:00
Miek Gieben 9f8f2e3a3c Release 1.1.42 2021-05-07 09:31:52 +02:00
Miek Gieben 21ccaf84aa
Bump go.mod and rename reuseport files (#1259)
Go 1.11 was a long time ago, so rename the reuseport go files to
something more sane. Contemplated _unix, or _posix but that didn't
really cut it. Went with reuseport and no_reuseport.

Also bump go.mod to 1.14

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-05-07 09:30:50 +02:00
Miek Gieben cce7f43db4
OPT: add Z and SetZ methods (#1246)
* OPT: add Z and SetZ methods

Fixes: #1169

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

* code review feedback

Change the mask and use and not (&^)

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

* Code review changes

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-05-05 15:38:29 +02:00
Fredrik Lönnegren 2a9acc8d83
Check if DNSKEY Zone-Key bit is set on RRSIG Verify (#1258) 2021-05-05 15:38:06 +02:00
Andrey Meshkov c99ea652e3
Fix copy() in SVCBIPv4Hint and SVCBIPv6Hint (#1256)
* Fix copy() in SVCBIPv4Hint and SVCBIPv6Hint

The problem with the current implementation is that it is not a real deep copy,
it points to the same base arrays behind the slices. This was causing some
issues in real-life application.

* Address review comments
2021-04-23 09:09:34 +02:00
Miek Gieben 88913150f0
Remove HmacMD5 from the documention (#1255)
* Remove HmacMD5 from the documention

The aglo is deprecated.

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

* bump to sha256

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-04-19 12:10:52 +02:00
Daniel Tang 83b388a80c
Add support for extended DNS errors (RFC 8914). (#1253)
Automatically submitted.
2021-04-08 15:11:06 +00:00
Miek Gieben 40060b4a4b
zoneparser: document not checking syntax (#1245)
* zoneparser: document not checking syntax

Add a couple of lines that we're not syntax checking.

Closes: #948

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

* Update wording after review.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-03-22 16:21:34 +01:00
Miek Gieben ad89e5bc70
stop doing any fuzzing (#1247)
The whole fuzzing pipeline is broken. Comment it out for now.
See #1186 and #1223

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-03-22 15:47:47 +01:00
Miek Gieben 797f1f2953 Release 1.1.41 2021-03-19 07:46:51 +01:00
cesarkuroiwa a614451ab3
Use ed25519 from Go standard lib (#1243)
* Use "crypto/ed25519"

* Remove unused dependencies

* Version bump

Co-authored-by: Cesar Kuroiwa <cesar@registro.br>
2021-03-16 15:37:10 +01:00
Tom Thorogood e5407eb800
Remove fuzz from .github/workflows/go.yml (#1238) 2021-03-04 16:40:54 +01:00
Tom Thorogood 40ce7c7df7
Bump go versions in .github/workflows/go.yml (#1237)
* Bump go versions in .github/workflows/go.yml

These are very out of date and it's causing persistent failures in the
fuzz CI step.

* Remove GOPATH=$GOROOT assignment

go1.16 shows a warning:
  "warning: GOPATH set to GOROOT (/opt/hostedtoolcache/go/1.16.0/x64) has no effect"
2021-03-04 07:32:55 +01:00
Tom Thorogood b694ab3d93
Update go.mod dependencies (#1236)
Automatically submitted.
2021-03-04 06:25:23 +00:00
Miek Gieben 4fdbc51bbd
Run a go fmt -w -s (#1235)
Noticed a non-gofmted `;` earlier, run gofmt -w -s on all files.

(mechanical change)

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-03-01 15:30:32 +01:00
Miek Gieben db96610e5e
loc: use float64 to get enough precision (#1234)
Fixes: #1232

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-03-01 15:19:31 +01:00
madestro 375601dc88
Implementation of zone digest (ZONEMD) (#1208)
* adding ZONEMD

* adding ZONEMD

* deleting extra cod

* updating constants

* updating mod

* updating release

* Moving ZONEMD Implementation to project structure

* re adding indirect tools import

* case-insensitive digest

* fixing if zone has rfc 3597 RRs

* remove .idea folder

* restore go.mod imports

* gofmt files

* pseudo rollback

* after go generate...

* parsing zonemd in rfc3597

* removing the check for a STRING as HAsh Algorithm in ZONEMD, RFC says only numbers go there

* adding ZONEMD constants

* Reverting changes in generate.go

un-gofmt ing generate.go file

* Reverting changes in generate.go

un-gofmt ing generate.go file

* remove ZoneMD reserved types

* remove zonemd RFC3597 branch in ZONEMD parser

* revert rfc3597 related modifications

* revert rfc3597 related modifications

* removing unintentional changes from go.sum and types.go

* add line break to go.sum

* removing spaces from types.go

* Use ZONEMD official RFC link as reference

* Add ZONEMD parsing test

* Update parse_test.go

Co-authored-by: Miek Gieben <miek@miek.nl>

Co-authored-by: Eduardo <eriveros@dcc.uchile.cl>
Co-authored-by: Eduardo <e.sdfbsadjhgskndwegit@xor.cl>
Co-authored-by: Eduardo <e.git@xor.cl>
Co-authored-by: Miek Gieben <miek@miek.nl>
2021-02-26 16:35:05 +01:00
Josh Soref 883641f4a9
Spelling (#1222)
* spelling: artifacts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: encoding

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exponent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: ignoring

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: implemented

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: implements

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: next

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: numeric

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: previous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: positions

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: presentation

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: resetting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: stringifying

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: subsequent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: validated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Miek Gieben <miek@miek.nl>
2021-02-25 17:08:05 +01:00
Shubhendra Singh Chauhan 2f14d104f3
improve code quality (#1228)
* Combine multiple `append`s into a single call

* Fix Yoda conditions

* Fix check for empty string

* revert "combine multiple `append`s"
2021-02-25 17:01:55 +01:00
Miek Gieben 9884b9f446 Release 1.1.40 2021-02-25 11:00:46 +01:00
R+ 2543d8bb2d
Close the UDPConn before returning if `setUDPSocketOptions` went wrong (#1227)
Detail: https://github.com/miekg/dns/issues/1226
2021-02-25 09:24:39 +01:00
Nikolay Nikolaev c08efdcc07
readme: adding Kuma.io (#1225)
Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
2021-02-23 10:54:40 +01:00
Miek Gieben 4ec3e54a9e Release 1.1.39 2021-02-23 10:30:20 +01:00
Miek Gieben 4495f1939f
readme: add CAA and ZOMEMD RFCs (#1224)
Try to keep this list semi up to date.

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-02-23 10:10:31 +01:00
Andrey Meshkov 67bd57debd
Send DNS query in one packet when using TCP/TLS (#1219)
* Send DNS query in one packet when using TCP/TLS

* fix review comments

* Removed net.Buffers

* Added unit-tests for writing messages over TCP in one go
2021-02-13 19:49:02 +01:00
unknowndev233 7d5e1ea350
README.md: Users list update: add v2fly/v2ray-core (#1220) 2021-02-10 07:42:07 +01:00
chantra ee8fef6743
Update Truncate doc with compress behaviour (#1217)
* Update Truncate doc with compress behaviour

This is a documentation update to highlight the behaviour of Truncate, which will reset dns.Compress to false when the message fits in the requested size without truncation, and make it the caller responsibility to set it back to true if they wish to compress, regardless of fitting, uncompressed, in the requested message size in the first place or not.
Fixes #1216

* address comments

* d/Note that/
* s/reset/set/
* s/caller/caller's/
* removed backticks

* regardless of size
2021-02-10 07:41:26 +01:00
Miek Gieben 35023fab5c Release 1.1.38 2021-02-01 09:20:37 +01:00
Tom Thorogood 2fd5af9f92
Validate Rdlength and off in UnpackRRWithHeader (#1215) 2021-02-01 09:15:50 +01:00
Tom Thorogood e6df8867af
Fix Rdlength related parsing bug in RFC3597 records (#1214)
* Set Rdlength in fromRFC3597

This was a bug found by oss-fuzz. My bad (#1211).

* Limit maximum length of Rdata in (*RFC3597).parse

RDATA must be a 16-bit unsigned integer.

* Validate Rdlength and off in UnpackRRWithHeader

* Revert "Validate Rdlength and off in UnpackRRWithHeader"

This reverts commit 2f6a8811b944b100af7605e53a6fb164944a6d65.

* Use hex.DecodedLen in (*RFC3597).fromRFC3597

While this isn't done elsewhere, it is clearer and more obvious.
2021-02-01 09:10:38 +01:00
Miek Gieben ba2d042a57 Release 1.1.37 2021-01-30 14:07:04 +01:00
Miek Gieben a1362108be Merge branch 'master' of github.com:miekg/dns 2021-01-30 14:06:35 +01:00
Miek Gieben a25c26b5ed Release 1.1.36 2021-01-30 14:06:14 +01:00
Tom Thorogood 13238cb6ad
Support parsing known RR types in RFC 3597 format (#1211)
* Support parsing known RR types in RFC 3597 format

This is the format used for "Unknown DNS Resource Records", but it's
also useful to support parsing known RR types in this way.

RFC 3597 says:

   An implementation MAY also choose to represent some RRs of known type
   using the above generic representations for the type, class and/or
   RDATA, which carries the benefit of making the resulting master file
   portable to servers where these types are unknown.  Using the generic
   representation for the RDATA of an RR of known type can also be
   useful in the case of an RR type where the text format varies
   depending on a version, protocol, or similar field (or several)
   embedded in the RDATA when such a field has a value for which no text
   format is known, e.g., a LOC RR [RFC1876] with a VERSION other than
   0.

   Even though an RR of known type represented in the \# format is
   effectively treated as an unknown type for the purpose of parsing the
   RDATA text representation, all further processing by the server MUST
   treat it as a known type and take into account any applicable type-
   specific rules regarding compression, canonicalization, etc.

* Correct mistakes in TestZoneParserAddressAAAA

This was spotted when writing TestParseKnownRRAsRFC3597.

* Eliminate canParseAsRR

This has the advantage that concrete types will now be returned for
parsed ANY, NULL, OPT and TSIG records.

* Expand TestDynamicUpdateParsing for RFC 3597

This ensures we're properly handling empty RDATA for RFC 3597 parsed
records.
2021-01-30 14:05:25 +01:00
Tom Thorogood f9dc403cff
Fix potentially truncated int casts in $GENERATE code (#1212)
These were flagged by GitHub CodeQL code scanning as potential
vulnerabilities or issues. Fixing them is easy and they are incorrect.

Adding tests is less easy because int is 64-bits on most systems,
including those we test on, so we can't consistently provoke a failure
here.
2021-01-30 10:07:06 +01:00
Matt Dainty 731b191cab
Add a link to https://github.com/bodgit/tsig (#1206) 2021-01-09 09:37:20 +01:00
Matt Dainty 59aea23afe
Add GSS-TSIG support (#1201)
Automatically submitted.
2021-01-07 14:28:20 +00:00
Janik at Cloudflare 23c4faca9d
Fix comment about SVCB values in AliasMode (#1202)
Automatically submitted.
2020-12-18 19:16:09 +00:00
Till! 428cef3187
Add a link for dnsbl_exporter (#1194)
Adding a shameless plug to my Prometheus exporter. ;) Thanks for sharing your code on here.
2020-11-06 18:31:18 +01:00
Miek Gieben 91eca25c30
Remove travis (#1193)
This also removed the codecov that was still done. We could potentially
re-add as an action, but I don't really miss it. Add testing for 1.14
and 1.15 (it's very fast now).

Fuzzing needs to stay on 1.14 due to brokeness of some kind.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-06 18:30:22 +01:00
Catena cyber 9732cfa6b8
Runs CIFuzz only when go files are modified (#1192)
and run it for 5 minutes instead of 10
2020-11-05 15:35:21 +01:00
Miek Gieben 1ba9487b18
make the client.Exchange doc work (#1190)
Remove the newline so the comment is picked up as documentation.

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-10-26 14:10:31 +01:00
Miek Gieben 3b41a31342 Release 1.1.35 2020-10-25 09:22:05 +01:00
Tom Thorogood fa528cceb7
Fix PacketConnReader typo in DecorateReader docs (#1189) 2020-10-25 02:26:19 +10:30