Commit Graph

42 Commits

Author SHA1 Message Date
Miek Gieben 9dcf47a409
Doc updates (#1075)
* Doc updates

Was reading https://pkg.go.dev/github.com/miekg/dns?tab=doc and spotted
some types and things to could be slightly better.

Make v unexported, as this version stuff should not be part of the
public API.

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

* fix test

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-02-14 22:47:21 +01:00
Tom Thorogood 71bbe52b67
Hoist SHA1 check in HashName
That's all that's supported by this function, and moving it makes the
code cleaner.
2018-11-29 10:44:01 +10:30
Tom Thorogood c2889aea81
Reduce wireSalt allocation in HashName 2018-11-29 10:30:02 +10:30
Tom Thorogood 1afd10068a
Rename wire to wireSalt in HashName
This is slightly clearer.
2018-11-29 10:25:34 +10:30
Tom Thorogood 4058ac87fa
Remove saltWireFmt from nsecx.go
This isn't really needed and doesn't make the code any clearer.
2018-11-29 10:24:25 +10:30
Yasar Alev 043a442757 nsec3 cover problems (#804)
* nsec3 cover fix

* nsec3 cover fix test

* nsec3 covered empty intervals

* nsec3 another condition

* nsec3 empty interval wildcard test

* nsec3 empty interval comment
2018-11-13 23:30:58 +00:00
Roland Bracewell Shoemaker 6ebcb714d3 NSEC/3 Cover+Match cleanup (#479)
* Initial NSEC cleanup

* Use readable names

* Finish tests

* Use existing functions, simplify hash/zone split

* Make IsSubDomain case insensitive, add tests

* Use internal Split instead of strings.Split
2017-04-12 19:47:48 +01:00
Tom Thorogood b6ecf29d98 Improve performance by addressing some low hanging fruit. (#444)
* Remove unused bytes.Buffer from dns/idn.encode.

This buffer is truncated and written to but never read from. It
serves no purpose and all tests pass with it removed.

It appears to have been introduced when puncycode.go was first
added in miekg/dns@e3c2c07.

* Produce less pointless garbage.

This change:
- removes several needless []byte -> string conversions,
- removes two needless append calls in HashName, and
- writes the hash to the same nsec3 []byte in HashName rather
  than creating a new []byte on each of the k iterations.

These are all minor performance improvements that will likely
go entirely unnoticed. The changes will reduce the ammount of
garbage produced when calling CertificateToDANE, HashName,
(*SIG).Sign and TsigGenerate.
2017-02-02 07:33:49 +00:00
Miek Gieben e6b37d00af Cleanup and removals (#377)
* Cleanup and removals

Gut rawmsg.go as most functions are not used. Reword some documentation.
Add more types to be checked for name compression.

* Yeah, we do use these

* Remove this function as well - only used one
2016-06-13 19:44:38 +01:00
Miek Gieben b51e305bc6 Remove reflection (#376)
Everything is generated. Remove all uses of packStruct/unpackStruct and
make the library reflectionless.
2016-06-12 21:06:46 +01:00
Miek Gieben 67945c119e A bunch of golint fixes
The proposed vars names are a nono, because they break the API.
Things left: document each RR and zscan_rr.go has some funcky if-then-elses.
2015-02-19 09:58:33 +00:00
Filippo Valsorda 0f1b1184ae Rename and simplify packing helper functions 2014-12-05 19:27:44 +00:00
Miek Gieben 0aa3021a83 Remove all copyright notices
Use the central COPYRIGHT file.
2014-09-11 20:57:37 +01:00
Miek Gieben 09c28d4a95 comment 2014-06-14 12:48:44 +01:00
Miek Gieben ec304aeaa7 Split off stuff to package chain
Create a resolver package called chain, to keep in the spririt
of Bind, Unbound, Drill and Knot (and maybe others)
2013-12-25 21:00:19 +00:00
Miek Gieben 2c460e62ed ... and in the tests too 2013-12-25 20:09:22 +00:00
Miek Gieben 0c252cfd17 Rename Proof to VerifyNameError 2013-12-25 20:07:46 +00:00
Miek Gieben 8c9af25e1f Fix NSEC3 Proof tests 2013-12-25 19:53:08 +00:00
Miek Gieben 355e3be472 Add NSEC3 NXDOMAIN proof 2013-12-25 19:44:17 +00:00
Miek Gieben 35b2db6df4 Add Proof function for NSEC/NSEC3 2013-12-25 16:01:39 +00:00
Miek Gieben 6e19a3d570 Add NSEC prototype 2013-12-24 16:54:20 +00:00
Miek Gieben 970b2239a1 Add NSEC3 helper function back in
I'm going to use this in 'q', but it may came in handy for other
developers too. This is the first ramp up to a full blown Go only
recursive resolver.
2013-12-24 16:52:39 +00:00
Miek Gieben 52731e78c5 Clean up the nsecx file
Stuff never worked. Remove it for now
2013-08-16 22:20:09 -07:00
Miek Gieben 68716ada83 Unused 2013-08-16 22:18:21 -07:00
Miek Gieben 38ea608d79 Rename the Label* functions
SplitLabels -> SplitDomainName
CompareLabels -> CompareDomainName
LenLabels -> CountLabel
          -> NextLabel was added as a simple iterator-like function
2013-06-22 07:21:15 +00:00
Miek Gieben 81941d4422 Update all copyright notices 2013-05-12 16:15:52 +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 288df5bcc8 remove the w-i-p nsec3 stuff
Not useful, if you want to validate: use unbound
2012-11-20 10:12:00 +01:00
Miek Gieben 570bf8dc69 Use proper error in packing and unpacking
All the relevant functions now return an error instead of
a simple boolean. This greatly approves the feedback to coders.

Spotted some fishy error handling along the way and fix that too.
2012-10-09 21:17:54 +02:00
Miek Gieben 3a6edfa2c9 fmt 2012-09-10 20:51:19 +02:00
Miek Gieben 9fd69abe09 struct embedding 2012-09-05 16:31:48 +02:00
Miek Gieben 4a8cf09877 use rr instead of nsec 2012-09-02 11:45:29 +02:00
Miek Gieben b0fc5a2f22 re-export these - I use them in unbound 2012-08-20 18:03:15 +02:00
Miek Gieben 1687a13438 Further minimize the lib 2012-08-20 09:39:10 +02:00
Miek Gieben 7b406f80ce dont export 2012-08-17 08:34:46 +02:00
Miek Gieben 2d2b4f5e64 tweaks to give more power to unbound package 2012-07-01 20:58:54 +02:00
Miek Gieben c8b7cea5a7 Add denialer interface 2012-06-06 15:27:35 +02:00
Miek Gieben f0f567c5f7 small tweaks in the NSEC3 code 2012-06-06 07:36:45 +02:00
Miek Gieben 1948cd2a90 Use go vetted struct tags
They had the form: "domain-name", now they are key value pairs (key is
always dns: `dns:"domain-name"`
2012-04-29 21:55:29 +02:00
Miek Gieben 492ec63401 prototype nsec cover method 2012-03-08 21:16:51 +01:00
Miek Gieben 84fccc1bfe Rename nsec3 to nsecx as nsec stuff will be added 2012-03-08 21:14:19 +01:00