Commit Graph

3622 Commits

Author SHA1 Message Date
Marcus Grando 58f52c57ce Change VERSION private RR to use reserved space (#415) 2016-10-18 07:08:08 +01:00
Miek Gieben 46df8c9462 Fix for miekg/dns issue #289: support the SMIMEA record (#410)
1) Refactoring of tlsa.go
   - moved routine to create the certificate rdata to its own go module
     as this is shared between TLSA and SMIMEA records
2) Added support for creating an SMIMEA domain name
3) Developed in accordance with draft-ietf-dane-smime-12 RFC

Miek,

Submitting for your review. Happy to make any recommended changes or
address omissions.

Lightly tested against our internal DNS service which hosts DANE
SMIMEA records for our email certificates.

Parse tests are added.
2016-10-17 18:09:52 +01:00
Marcus Grando dfae8d8799 Fix miek.nl post link (#414) 2016-10-17 18:09:10 +01:00
Marcus Grando 3efeaabb39 Respect range of RFC6895 (#413) 2016-10-17 17:55:37 +01:00
Bilal Amarni fc4e1e2843 readme - add dockness to user list (#388) 2016-10-06 11:00:29 +01:00
Shane Kerr b96e5025a3 Simple function to clear the DO bit from an OPT resource record. (#407)
* Function to clear the DO bit from an OPT RR.

* Tests for ClearDo() function.

* Changed from ClearDo() to SetDo() with an optional argument.

* Update doc string for SetDo(). Make tests for SetDo() comprehensive.
2016-10-05 09:08:39 +01:00
Faraz Fallahi fce7af874c Add MicroDNS (#408) 2016-10-04 18:15:48 +01:00
Preet Bhinder 3f1f7c8ec9 Fix a couple of comments (#386) 2016-10-03 19:18:08 +01:00
Mehrdad Arshad Rad cb2f719c71 added mylg link to README (#397) 2016-10-03 15:37:16 +01:00
S.Çağlar Onur cd5a49decd Add a badge for godoc (#395) 2016-10-03 15:37:09 +01:00
Pavel Odintsov 8d8a1ec575 Check input data for NewPrivateKey (#399) 2016-10-03 15:36:51 +01:00
Roland Bracewell Shoemaker 574f29b9d6 Always set tokenUpper when setting token (#403) 2016-10-03 15:10:26 +01:00
Kevin Burke b4e7237e90 Fix typos (#405) 2016-10-03 15:10:00 +01:00
Miek Gieben db96a2b759 Handle empty salt value (#392)
When removing the reflection we inadvertely also removed the code for
handling empty salt values in NSEC3 and NSEC3PARAM. These are somewhat
annoying because the text representation is '-', which is not valid hex.
2016-07-25 20:20:27 -07:00
Miek Gieben 5d001d0209 zmsg: return empty rr with header (#380)
When there is no rdata, return the newly created RR with the header
embedded in it. If we only return the header, we changed the
API for Go DNS.
2016-06-14 17:21:01 +01: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 dbffa4b057 Kill all reflection when packing/unpacking RR (#372)
Update the size-xxx-member tags to point to another field in the struct
that should be used for the length in that field. Fix NSEC3/HIP and TSIG
to use to this and generate the correct pack/unpack functions for them.

Remove IPSECKEY from the lib and handle it as an unknown record - it is
such a horrible RR, needed kludges before - now just handle it as an
unknown RR.

All types now use generated pack and unpack functions. The blacklist is
removed.
2016-06-12 18:31:50 +01:00
Miek Gieben 6ae3b9f061 Skip reflection for most types (#369)
Make the reflection types a black list (these types use (or should use)
the tag 'size-xxx' in their struct definition.s

HIP, IPSECKEY, NSEC3, TSIG

All other types don't use reflection anymore.

* Return a pointer to the header when there is no rdata, this restores old
  behavior. The rest of the conversion mostly hangs on getting size-hex
  right, but then packStruct and packStructValue and the unpack variant
  can be killed.
* Generate pack and unpack for all embedded types as well.
* Fix PrivateRRs, register an unpack function as well, when you register
  a new PrivateRR.
* Add the tag octet, nsec, []domains and more  to msg_helper.go
2016-06-12 16:09:37 +01:00
Miek Gieben 331ecbbc51 Add RcodeBadCookie (23) 2016-06-12 13:10:24 +01:00
Miek Gieben e048e89b44 Extra doc for DNS Cookies 2016-06-11 09:37:01 +01:00
Miek Gieben ee126a9f10 RFC 7858 and 7873 are published 2016-06-11 09:21:11 +01:00
Michael Haro 1be7320498 Use t.Errorf in tests and make the error variable naming more consistent. (#367)
* Make the error variable always named err.

Sometimes the error variable was named 'err' sometimes 'e'.  Sometimes
'e' refered to an EDNS or string and not an error type.

* Use t.Errorf instead of t.Logf & t.Fail.
2016-06-09 07:00:08 +01:00
Michael Haro 48c8acaf0c Simplify packing and unpacking (#363)
* Simplify packing and unpacking

* Make a copy of the buffer to allow buffer reuse.

* Revert use of fmt.Sprintf

I don't have time to benchmark this right now and I suspect a different
cleanup will be of higher value.
2016-06-08 17:10:03 +01:00
Michael Haro a465e84f54 Use encoding/binary's conversion functions when possible. (#364)
* Remove {un,}packUint{16,32}Msg functions.

unpackUint16Msg unpackUint32Msg packUint16Msg packUint32Msg implemented
functionality that is part of the encoding/binary package.

* Use encoding/binary's encoding in more places.
2016-06-08 16:38:42 +01:00
Miek Gieben 799de7044d Remove WKS support
Support for WKS was incomplete, i.e. len() method was incorrect.
Remove support for the record and handle it as an unknown one.

Fixes #361
2016-06-05 08:23:44 +01:00
Miek Gieben 907a4aef57 Generate pack/unpack for all RRs (#360)
Add dns:txt parsing helper to prevent compile errors. This allows
us to generate all unpack/pack function.

Add pack to the RR interface definition and add this method to
PrivateRR.

We still use typeToUnpack to select which types don't use reflection.
2016-06-05 07:53:12 +01:00
Roland Bracewell Shoemaker 3f53d75269 Seed math/rand with crypto/rand (#359)
* Use crypto/rand to seed math/rand instead of using the default seed

* Better seeding+generation and fallback on crypto/rand.Read failure

* Remove user warning
2016-06-05 07:51:30 +01:00
Joe Farrell bd738b30b1 Fixed typo in docstring (#358) 2016-06-04 08:11:36 +01:00
Miek Gieben cbeae15006 Merge branch 'generate_pack' 2016-06-03 12:48:12 +01:00
Miek Gieben 475ab80867 Remove (most) reflection
Remove the use of reflection when packing and unpacking, instead
generate all the pack and unpack functions using msg_generate.
This will generate zmsg.go which in turn calls the helper functions from
msg_helper.go.

This increases the speed by about ~30% while cutting back on memory
usage. Not all RRs are using it, but that will be rectified in upcoming
PR.

Most of the speed increase is in the header/question section parsing.
These functions *are* not generated, but straight forward enough. The
implementation can be found in msg.go.

The new code has been fuzzed by go-fuzz, which turned up some issues.

All files that started with 'z', and not autogenerated were renamed,
i.e. zscan.go is now scan.go.

Reflection is still used, in subsequent PRs it will be removed entirely.
2016-06-03 12:45:22 +01:00
Erik Dubbelboer 48ab6605c6 go fmt (#355) 2016-05-12 07:43:16 +01:00
phamhongviet b5deb9f6c0 Add serf-dns to the user list (#353) 2016-05-07 14:17:04 +01:00
Miek Gieben f53eb22bfb Check length before packing OPT (#352)
fixes #351
2016-05-05 16:56:17 +01:00
Miek Gieben 4355939008 massage edns cookie comment 2016-05-03 15:22:17 +00:00
Shumon Huque b534177a1a small patch for EDNS0 cookie support (#350)
* Add EDNS0 Cookie (option 10) support.

* Add EDNS0 Cookie processing.

* Fix nits.

* Add EDNS0 cookie support mention.
2016-05-03 16:19:28 +01:00
looter de1d5dd281 Added grimd project (#349) 2016-05-03 09:16:38 +01:00
Will Bond c9d1302d54 Add Client.Timeout to allow limiting total exchange duration (#345) 2016-04-19 11:29:51 +01:00
McStork a5cc44dc6b set ExtendedRcode return type to int instead of uint8 (#347) 2016-04-18 17:40:15 +01:00
Miek Gieben 89d9c5e74b Merge pull request #346 from jsha/patch-1
Update README.md
2016-04-14 17:49:32 +01:00
Jacob Hoffman-Andrews 8d74112f68 Update README.md 2016-04-14 09:22:05 -07:00
Jacob Hoffman-Andrews 031fad65fe Use package name more reliably. (#343)
The previous logic would act incorrectly when this package was vendored into
other packages.
2016-04-14 08:48:01 +01:00
Miek Gieben dd83d5cbcf IsSubDomain docs
Improve the docs a little and add a test for when the child and parent
are equal.
2016-04-12 22:05:53 +01:00
Miek Gieben b5f8285e2a Merge pull request #340 from miekg/edns2-fix
Put the correct extended rcode in OPT
2016-04-09 16:17:25 +01:00
Miek Gieben 84206d880d Put the correct extended rcode in OPT
We were off by a value of 15. This fixes it. Hard to come up with a test
as writing and reading it yourself will be consistent.
Don't allows extended rcodes smaller than 16. And fix the tests as well.
2016-04-09 16:07:18 +01:00
Miek Gieben c70f867d87 Merge pull request #338 from miekg/edns-fix
Optimize IsEdns0
2016-04-09 15:53:29 +01:00
Miek Gieben 51f75cadab Optimize IsEdns0
Start at the end of the additional section instead of the beginning.
Optionally we only scan the last 2 records, and get rid of the loop
in its entirety.
2016-04-08 08:22:36 +00:00
Miek Gieben 7e024ce8ce Merge branch 'master' of github.com:miekg/dns 2016-03-28 15:46:43 +01:00
Miek Gieben b4a9a147b2 Small fix in docs for transfer Out 2016-03-28 15:45:23 +01:00
Miek Gieben c2b278e70f Merge pull request #335 from mischief/plan9
fix building on plan9
2016-03-25 16:41:19 +00:00