197 Commits

Author SHA1 Message Date
Miek Gieben
21b35db538 Remove the NSAP record
The NSAP was not implemented correctly, see #239. Just remove it. It will still work as unknown RR.
2015-08-10 07:26:35 +01:00
Miek Gieben
d7ca9f827c And check err here as well. 2015-08-07 16:56:49 +01:00
Miek Gieben
3861fcbbb2 Fix HIP parsing 2015-08-07 16:26:37 +01:00
Miek Gieben
d5324dc6e3 Fuzz the text parser
Check if the values send on the channel are errors, if so return
one. Otherwise continue parsing.
2015-08-07 15:01:11 +02:00
Miek Gieben
69d043f8ab Better fuzzing test and NSAP fix
rr can be nil when parsed, if it, for instance only contains a
comment.

NSAP parsing need some parens to make the if-then logic work.
2015-08-07 12:17:16 +02:00
Miek Gieben
1e6d260018 Fuzz NewRR
Add checks for token length == 0.
2015-08-07 10:39:21 +01:00
Miek Gieben
3085a49d25 disallow multiple uri fragments 2015-07-28 21:44:50 +01:00
Miek Gieben
b26019349a make dynamic updates work for URI 2015-07-27 22:22:18 +01:00
Miek Gieben
179a68fbec Some small fixes 2015-07-27 22:12:46 +01:00
Miek Gieben
a34cf6798a Fix URI record
When the URI record became an RFC they slightly changed the format.
Make the needed changes.
2015-07-21 07:47:38 +01:00
Roland Shoemaker
52647ae7a7 Address miekg's comments 2015-06-18 19:17:02 -07:00
Roland Shoemaker
020002b9e0 Switch setCAA, CAA.String to presentation format, add various encoding helpers 2015-06-17 16:06:31 -07:00
Roland Shoemaker
1995ce2be4 Fix unpacking 2015-06-16 13:55:19 -07:00
Roland Shoemaker
e745789a1e Fix typo 2015-06-16 11:57:09 -07:00
Roland Shoemaker
522331911d Enable CAA parsing 2015-06-16 02:01:28 -07:00
Alex Sergeyev
32bf0823e2 Support for almost all possible ways to format HINFO record 2015-05-07 12:09:05 -04:00
Alex Sergeyev
fe15681571 Fixed reversed logic. 2015-05-07 11:31:23 -04:00
Alex Sergeyev
2e9176243e Updated NSAP support according to RFC1706
New text format 0x and no more length in the object itself.
2015-05-07 10:18:47 -04:00
Alex Sergeyev
d2bed60478 Fixed SSHFP parsing when multiple lines used for text representation. 2015-05-07 09:50:44 -04:00
Miek Gieben
28965350a6 Check the l.err token errors
If found return them. Not that we only return them in looping
constructs, i.e. endingTo*, in the other ones it will silently fail
still.
2015-05-07 12:47:56 +01:00
Filippo Valsorda
4657816178 Add ToCDNSKEY and ToCDS methods (+bugfix) 2015-04-10 18:54:04 +01:00
Miek Gieben
12197b977e In TXT records break up large chunks in 255 bytes
TXT records consist out of multiple 255 byte chunk. When parsing
a chunk that is too large, Go DNS would happily add it. This would
only fail when packing the message.

Change this to auto-chunking when reading the TXT records from file
into 255 byte sized chunks.
2015-03-04 09:33:37 +00:00
Michael Haro
eb9bd9895b Revert "Run gofmt -s on zscan_rr.go"
This reverts commit eaabc3fc5dc783f617f5a7dc9356b7aaa07f1d01.
2015-02-26 01:48:21 -08:00
Michael Haro
eaabc3fc5d Run gofmt -s on zscan_rr.go 2015-02-26 00:41:21 -08:00
Miek Gieben
0bd3fb7026 Match docs with constants 2015-02-20 21:16:49 +00:00
Miek Gieben
34ac642c72 Golint cleanups
This cleans up zscan_rr.go's if-then-else blocks. Except the ones
in LOC parsing because that needs slightly more than a mechanical
change.
2015-02-20 11:33:10 +00:00
Miek Gieben
b02ae55fbe golint changes, lose the underscores 2015-02-19 10:45:59 +00: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
Miek Gieben
477cb4d3fa Implement IPSECKEY
IPSECKEY is kinda strange because it has a type selector which tells
what type a later rdata field has. The type can be a domainname, address
or v6 address. You sort of wish Go would have a union type for this, but
alas.
Currently this is implemented as:

	GatewayA    net.IP `dns:"a"`
	GatewayAAAA net.IP `dns:"aaaa"`
	GatewayName string `dns:"domain-name"`

In the IPSECKEY. Only one of these is active at any one time. When
parsing/packing and unpacking the value of GatewayType is checked
to see what to do.

Parsing from strings is also implemented properly and tested. The Unpack
function still needs work.
2015-01-25 10:58:30 +00:00
Miek Gieben
d33af8db79 Update test and gofmt 2014-11-09 16:09:49 +00:00
Miek Gieben
deb8fe381f Cleanup the identical parsing functions.
Some records are copies from others: DNSKEY, CDNSKEY and KEY are
identical. DS, CDS and DLV are too and even RRSIG and SIG.

The parsing functions and the definition can all be used for parsing
all these identical types.
2014-11-02 11:29:55 +00:00
Andrew Tunnell-Jones
91b8c69a22 Implement SIG(0) signing and verification
This is based on @miekg's sig0 branch. That branch diverged from master
and I didn't want to wander off on a rebase.

As implemented there's no allowance for multi-envelope (TCP) support.

TODO:

* unpackUint32() could be moved out and used elsewhere
* tests
* multi-envelope support (if useful)
2014-11-01 11:32:46 +00:00
Miek Gieben
6bbae6c6ea Add CDNSKEY support 2014-10-23 22:18:23 +01:00
Alex Sergeyev
efb2e66078 Added support for mnemonic names in CERT rr
This behavior matches what bind does with thir formatting.
2014-10-07 21:27:25 -04:00
Alex Sergeyev
75472702d9 LOC record trips slurp detector.
Reverted recent true->false change for it to mitigate that.
2014-10-07 20:47:55 -04:00
Alex Sergeyev
aaf867499e Attempting to fix #133
- Trying to get as close to original state as possible
- Since private RR should not run slurp, toggling Variable there.
2014-09-23 21:59:09 -04:00
Miek Gieben
70556daa85 Dont export TypeToParserFunc 2014-09-16 07:20:40 +01:00
Miek Gieben
79861736a2 Factor the switch code in favor of TypeToParserFunc 2014-09-16 07:16:18 +01:00
Miek Gieben
17b0941344 Create and fill TypeToParserFunc 2014-09-16 07:15:34 +01:00
Miek Gieben
7962679920 Identical signature for all setXXX functions 2014-09-16 07:15:25 +01:00
Miek Gieben
e42e91096b make all setTYPE parse function return the same values 2014-09-16 07:15:16 +01:00
Miek Gieben
0aa3021a83 Remove all copyright notices
Use the central COPYRIGHT file.
2014-09-11 20:57:37 +01:00
Miek Gieben
5fd5c6d9eb And actually fix the parsing 2014-08-30 08:44:16 +01:00
Miek Gieben
cbb9881e96 Parse dynamic update RR in presentation format
Don't panic when encountering dynamic update RRs in zonefiles.
There are some other failure cases when parsing, those will be
fixed in subsequent commits.

Closes #110
2014-08-30 07:34:05 +01:00
Miek Gieben
f6c7c65fc4 Merge branch 'master' of github.com:miekg/dns 2014-08-29 09:42:53 +00:00
Miek Gieben
cfa561ed85 Add TestDynamicUpdateParsing test 2014-08-29 09:42:43 +00:00
Alex Sergeyev
05bec3968a Addressed cases when tokenUpper makes sense to be used. 2014-08-28 13:34:00 -04:00
Alex Sergeyev
9c4dca35d5 Removed unnecessary toUpper. 2014-08-28 12:59:54 -04:00
Miek Gieben
4d3dac9c36 Add the OPENPGPKEY RR. 2014-08-14 09:18:08 +01:00
Miek Gieben
ef732d1050 RRSIGs: parse epoch timestamp too
According to RFC4034 the timestamp in RRSIG may also be an EPOCH.
Check for this when parsing. Knot DNS zone dumps contain timestamp
RRSIG, this makes those parseable by Go DNS.
2014-01-11 08:50:10 +00:00