Commit Graph

333 Commits

Author SHA1 Message Date
Miek Gieben
35bcc78d76 Implement PX record 2013-10-13 13:23:02 +01:00
Miek Gieben
cc2c42cc91 Implement GPOS record 2013-10-13 13:01:33 +01:00
Miek Gieben
961e137891 Add NSAP and NSAP-PTR record 2013-10-13 12:25:08 +01:00
Ask Bjørn Hansen
8418a22857 Whitespace cleanup 2013-09-20 08:15:27 -07:00
Miek Gieben
b76ac5bde6 Fix the test 2013-09-12 08:14:42 +01:00
Miek Gieben
ee8ace0477 Merge branch 'master' of github.com:miekg/dns 2013-09-11 08:22:23 +01:00
Miek Gieben
32b15d1807 Add more IsDomainName tests 2013-09-11 08:22:20 +01:00
Miek Gieben
9c1ee5d5ca Update IsDomainName
This new functions just compiles the domain to wire format, if that
works, the name is deemed OK. It is also much less strict than the
older code. Almost everything is allowed in the name, except two
dots back to back (there is an explicit test for that).
2013-09-10 18:09:22 +00:00
Miek Gieben
a5ac1f46ee ...and fix the imports for the test files 2013-09-09 22:20:48 +01:00
Miek Gieben
81d35ce537 Move some functions to the correct file
DNSSEC tests go in dnssec_test.go
2013-09-09 22:19:24 +01:00
Miek Gieben
555318a03a Merge branch 'compress' 2013-06-29 09:49:12 +01:00
Miek Gieben
73e03fe818 Another txt variant to test for 2013-06-29 08:46:34 +01:00
Miek Gieben
57fae415e0 Get the testcases going 2013-06-26 20:34:40 +01:00
Miek Gieben
b9f82b0a36 Cherry-pick specific hunks 2013-06-26 20:33:01 +01:00
Miek Gieben
5ae9b5214f more testing and concurrent server benchmarking 2013-06-22 08:55:30 +01:00
Miek Gieben
5d094e6e2d gofmt 2013-06-14 19:42:55 +01:00
Miek Gieben
9ee7c27e18 Fix rawSetRdlength
When searching for the start of the rdata, the offset wasn't properly
calculated. This only impacted names with \DDD in it (weirdly enough).
2013-06-14 11:35:06 +00:00
Miek Gieben
3f348f173b \DDD to buf parsing fails (sometimes)
Added test (that fails for now)
2013-06-14 07:31:22 +01:00
Miek Gieben
5d84523f5b Move pack_test to parse_test 2013-06-13 19:19:40 +01:00
Miek Gieben
637fed84a4 Remove tests for zone 2013-06-05 20:41:53 +01:00
Miek Gieben
c66494c6c5 Resolv merge conflicts 2013-05-12 19:08:37 +02:00
Miek Gieben
f595bf7a06 Set license on test files 2013-05-12 16:09:52 +02:00
Miek Gieben
a5a709cd2a Rename securityConfig to sortedNames 2013-05-09 09:30:38 +02:00
Miek Gieben
1133a39996 Beter test and isWildcard function 2013-05-07 22:04:30 +02:00
Miek Gieben
e1151d6edc Update the Zone structure for NSEC and NSEC3 2013-05-07 09:44:21 +02:00
Miek Gieben
9a80799666 Fix remaining zone.Remove* functions
Fix the remove function and make them more like zone.Remove()
2013-05-05 21:52:21 +02:00
Miek Gieben
ba747fd510 Add some more tests 2013-05-05 20:30:39 +02:00
Miek Gieben
495b7d6552 Add UID/GID/UINFO record 2013-04-30 16:42:04 +02:00
Miek Gieben
f43b7368bd Add tests for EUIxx 2013-04-16 08:41:35 +01:00
Miek Gieben
ffca5f59b1 Make comments normative
Fixup the last RR and create a unit test
2013-03-04 15:40:22 +01:00
Miek Gieben
7b7eaaa4b0 Make (some) commments normative in zonefiles 2013-03-04 12:16:20 +01:00
Miek Gieben
525465db6d Add parse test and further tweaks 2013-03-04 11:24:08 +01:00
Miek Gieben
26994c382b gofmt 2013-01-28 14:34:18 +01:00
Miek Gieben
03c7b54668 Add parse test for DS record 2013-01-16 11:48:43 +01:00
Miek Gieben
3233964b4d Fix parse tests 2012-12-13 15:23:44 +01:00
Miek Gieben
7cdb2a8bc8 update the example tests 2012-12-13 14:57:19 +01: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
6e605f578e Make the line count error reporting more sane 2012-11-22 13:41:40 +01:00
Miek Gieben
fa55001b4c Add tests and fix bug in the parser
torc wasn't set in some part resulting in parsing a 'A' while
in fact the parsed record type should have been returned.
2012-11-22 11:54:46 +01:00
Miek Gieben
5a3db7b240 delayed newline counting
Fix a lot of corning cases for correct newline counting, but not
the ones where the closing brace is solely on a newline.
2012-11-21 22:21:40 +01:00
Miek Gieben
314a0eebcc Add support for L32, NID, L64 and LP records 2012-11-18 10:29:05 +01:00
Miek Gieben
5afca3330b Add tests and uppercase output of L64 2012-11-18 09:10:28 +01:00
Miek Gieben
43cadb2ffd Add parse test for octects in the name 2012-11-15 09:39:32 +01:00
Miek Gieben
dce8b2e71a gofmt 2012-10-10 22:17:50 +02:00
Miek Gieben
ca8b17dda2 Fix the tests 2012-10-09 22:15:33 +02:00
Miek Gieben
43f5cb9d27 add test 2012-10-05 09:49:31 +02:00
Miek Gieben
5c80e68e1e add tests 2012-09-17 08:56:27 +02:00
Miek Gieben
915781ea86 Better naming 2012-09-11 21:45:21 +02:00
Miek Gieben
49eebd3be4 fix benchmarking for zonedata 2012-08-25 21:30:16 +02:00
Miek Gieben
98e06078aa remove 2012-05-20 18:10:25 +02:00
Miek Gieben
251f3973f0 make it an example test 2012-05-20 15:41:14 +02:00
Miek Gieben
3a2cf2eda3 extra tests 2012-05-20 15:32:07 +02:00
Miek Gieben
9c67491aee cleanup and extra test 2012-05-20 15:31:35 +02:00
Miek Gieben
7a3af5b729 Support $GENERATE (the bind extension).
It is even better than the bind one, because all records are
supported (as long as the output is valid)
2012-05-20 15:28:27 +02:00
Miek Gieben
f0154aa0c2 Fix and test rfc 1982 arithmetic 2012-05-15 12:24:57 +02:00
Miek Gieben
3611c4d458 fmt 2012-05-05 17:37:48 +02:00
Miek Gieben
63f90d6546 LOC record parses (from wire and zonefiles) 2012-05-01 22:28:49 +02:00
Miek Gieben
79ea0f8e31 Fix LOC parsing 2012-05-01 22:21:44 +02:00
Miek Gieben
d30dcf93e0 Doesnt parse from string - otherwise it works 2012-04-30 23:59:15 +02:00
Miek Gieben
2ea2204a8b add test 2012-04-30 21:57:42 +02:00
Miek Gieben
d85d8f9fe9 Start adding LOC tests 2012-04-30 21:42:58 +02:00
Miek Gieben
872dc4fc6b Make the private key reading more natural 2012-04-15 20:55:25 +02:00
Miek Gieben
b58c604e17 Add symmetry to the reading of public/private keys
Add a NewPrivateKey that works on strings and calls ReadPrivateKey
that works on io.Readers.
2012-04-15 20:50:53 +02:00
Miek Gieben
134b557647 Start with validating Curve algos 2012-04-11 16:20:29 +02:00
Miek Gieben
1e1559423d Fix EC signing 2012-04-11 16:09:40 +02:00
Miek Gieben
b1099c10b8 More stuff for ecdsa. Need to find good abstraction 2012-04-11 15:42:33 +02:00
Miek Gieben
edf4b3d11b Test signing with ecdsa 2012-04-11 15:13:17 +02:00
Miek Gieben
a06e3e497c small tweak in the tests 2012-04-06 19:29:50 +02:00
Miek Gieben
df6d86e937 Fix for when not seeing an RR at all 2012-03-03 17:40:30 +01:00
Miek Gieben
3232814d1b Fix client side TSIG
Redesign of TSIG. Validation is on the TOOD - this can be
done in the same way as in the server.
2012-03-01 22:40:34 +01:00
Miek Gieben
172c89675c Add another weird looking RR to test 2012-03-01 09:16:28 +01:00
Miek Gieben
5fec355528 Allow TYPExxxx syntax in NSECx records 2012-02-28 20:20:07 +01:00
Miek Gieben
0c0b97f72b Parsing fix for lines starting with class or TTL
name.   IN SOA  a6.nstld.com. hostmaster.nic.name ....
              IN 7200   NS      j6.nstld.com.
              7200 IN     NS      k6.nstld.com.

Wasn't handled properly
2012-02-27 18:48:53 +01:00
Miek Gieben
89c05b4f74 gofmt 2012-02-23 19:37:08 +01:00
Miek Gieben
69cecf63bd Newline in text record 2012-02-23 19:15:06 +01:00
Miek Gieben
9c5c2ee96f Fix very large SOA/TTL values 2012-02-19 18:36:59 +01:00
Miek Gieben
71a776ddb5 Fix HIP and add ExampleHIP test function 2012-02-19 12:28:31 +01:00
Miek Gieben
88a0052d1d Fix newline/space handling and braces
( dsjkdjk
djsdjk
)

( dkjsdjsd
  djskdjsd
)

Are two different strings, the above contains NO spaces, the bottom
one does. This doesn't matter anywhere, except in HIP record, which
say some data may not contain spaces.
2012-02-19 12:04:27 +01:00
Miek Gieben
32ce3502ae add HIP here too 2012-02-19 11:27:16 +01:00
Miek Gieben
bc6eca4ec4 Put this in a example test function 2012-02-17 20:37:19 +01:00
Miek Gieben
542ca8ed6d Add ref to 4592 and tests it 2012-02-15 10:28:55 +01:00
Miek Gieben
d89f439689 Extra parse tests 2012-02-15 10:02:21 +01:00
Miek Gieben
ef524d882a Add features to soa parsing 2012-02-15 09:04:09 +01:00
Miek Gieben
63d8b1feb1 Implement TTLs in words
1H, 1M, 1W2D, etc. should now be parsed in TTLs
2012-02-14 15:14:54 +01:00
Miek Gieben
7ef88cf5b3 Add support for @
For this to work ParseZone was extended to accept a starting
origin. This way even zonefiles without $ORIGIN would work
as expected. This is an api change.
2012-02-14 13:46:40 +01:00
Miek Gieben
3bb902e549 Add more testing 2012-02-13 21:39:27 +01:00
Miek Gieben
37ef7bd219 More TXT related fixes
Add two corner cases for testing
2012-02-13 19:08:37 +01:00
Miek Gieben
2f64868d3c Add quotes to the parsing engine.
Support:
TXT
NAPTR

And other record that we may use.
2012-02-13 13:19:37 +01:00
Miek Gieben
42efa912b5 Almost there with parsing 2012-02-12 23:00:26 +01:00
Miek Gieben
a7b2a88e7a Parsing TXT records now works OK 2012-02-12 22:24:18 +01:00
Miek Gieben
6ddb9ab88b Txt record parsing works -- need to look at the on-the-wire stuff 2012-02-12 21:50:02 +01:00
Miek Gieben
5a48b54327 added quotes as important chars in the parser 2012-02-12 19:06:32 +01:00
Miek Gieben
9c478ab6e4 Add the dot in the correct place 2012-02-12 12:36:26 +01:00
Miek Gieben
a21f7c6b30 Documentation updates and parsing fixes 2012-02-12 11:45:44 +01:00
Miek Gieben
d7f4f61777 Clean up dead code 2012-02-12 11:16:26 +01:00
Miek Gieben
1f56983ce7 Add test for nsec-like records 2012-02-11 22:59:34 +01:00
Miek Gieben
19cef3f981 Parse SRV and PTR too 2012-02-11 17:03:09 +01:00
Miek Gieben
74181dee8e More tests 2012-01-22 20:44:52 +01:00
Miek Gieben
2718f6f23a Adapt test for new ParseZone api 2012-01-21 23:39:48 +01:00
Miek Gieben
9b48d4b899 gofmt 2012-01-12 22:49:26 +01:00
Miek Gieben
a3949750be Somewhat nicer 2012-01-12 11:17:01 +01:00
Miek Gieben
374e495534 More evil records to parse 2012-01-12 10:50:01 +01:00
Miek Gieben
6d95911558 Dont allow the question section to be compressed 2012-01-11 16:16:09 +01:00
Miek Gieben
bbd8c42de6 Fix the tests 2012-01-11 14:17:09 +01:00
Miek Gieben
8e1dd132a4 extra testcase 2012-01-08 21:37:37 +01:00
Miek Gieben
b417c42bc2 Fix handling of dnames
Add support for escaped dots. Only thing to fix is the
fqdn-ness of user defined names.
2012-01-08 14:53:55 +01:00
Miek Gieben
0322d3a9da Fix $ORIGIN in zonefiles
also check if a dname isn't fq, and add $ORIGIN is not.
2012-01-08 14:06:58 +01:00
Miek Gieben
362e606bf2 Make ParseZone more go like 2011-12-19 19:20:55 +01:00
Miek Gieben
e2b080d1b1 New time api 2011-12-18 21:01:32 +01:00
Miek Gieben
689bf97ed4 Send the last bits also 2011-12-18 18:15:09 +01:00
Miek Gieben
925d38c689 More parse tests 2011-12-18 13:56:27 +01:00
Miek Gieben
73012b7dd5 Fix braces and comments, esp for SOA records 2011-12-18 13:42:59 +01:00
Miek Gieben
15e1c0961b Make scan_rr much smaller 2011-12-18 11:22:40 +01:00
Miek Gieben
e69e60c05a Evil record gets parsed correctly 2011-12-17 13:59:38 +01:00
Miek Gieben
487e600562 Fix parsing when RR ends in a brace
* Testcase added
2011-12-17 11:28:54 +01:00
Miek Gieben
fc963a6a5a Add extra tests, esp braces when parsing 2011-12-17 10:16:24 +01:00
Miek Gieben
a4836a77a4 Make the test fail 2011-12-16 19:43:13 +01:00
Miek Gieben
512d1dae46 Fix the reading of private key files 2011-12-16 17:32:15 +01:00
Miek Gieben
a9e3ec9880 Dont include large files in the repo 2011-12-16 14:48:20 +01:00
Miek Gieben
c4f46f9937 Fix the parsetesting and do some performace tests 2011-12-16 14:38:52 +01:00
Miek Gieben
235dee6a0d Fix the parse tests once more 2011-12-16 10:26:32 +01:00
Miek Gieben
06ae052c32 Implement returning errors from the scanner 2011-12-16 10:06:28 +01:00
Miek Gieben
c6deba77e0 Fix the key parsing 2011-12-15 22:44:09 +01:00
Miek Gieben
35a1e137e2 More parsing fixes 2011-12-15 22:40:07 +01:00
Miek Gieben
f4329cce16 More parsing tweaks 2011-12-15 18:03:41 +01:00
Miek Gieben
9168608abd More parsing fixes 2011-12-15 17:49:43 +01:00
Miek Gieben
081166db5e Fix the tests (Again) + NewRR(str)
Parse tests start to get working again
NewRR reads a string and is the easiest way to get an RR
in your code.
2011-12-15 17:37:07 +01:00
Miek Gieben
131f6962d1 gofmt 2011-12-09 21:45:57 +01:00
Miek Gieben
05eb569938 Test and fix dynamic updates
* Update to the new Go version
* Fix lot of things that need fixes

Need a why to communicate half RRs (i.e. A record without rdata)
2011-12-09 21:12:03 +01:00
Taral
c1889c778d gofmt (excluding _examples) 2011-11-27 21:03:21 -08:00
Miek Gieben
406edadf20 Make the tests compile again 2011-09-10 21:22:42 +02:00
Miek Gieben
7ef1892814 Tests fails, but dont crash 2011-08-08 10:33:50 +02:00
Miek Gieben
05b7ac53dd Create qnamelist for nsec/nsec3 handling 2011-07-30 23:05:34 +02:00
Miek Gieben
e016536cdc Add nsec(3) support in the core zone structure 2011-07-29 22:06:09 +02:00
Miek Gieben
be10e40045 Fix Pop()
Need to check which of the rrs, rrsigs of nxt is actually filled
with the data and pop that.
2011-07-29 13:16:27 +02:00
Miek Gieben
33fbece4ca Add txt and fixup ds, ta and dlv 2011-07-29 12:18:20 +02:00
Miek Gieben
caa1502c1e Add much more complex zone structure
A zone is stored in a
map[string]map[int]*ZRRset

where string is the qname and int (in the second map) is
qclass * <large number> + qtype, thereby making it unique.

ZRRset holds:
    RRs     RRset
    RRsigs  RRset
    Nsec    RR
    Nsec3   RR
    Glue    bool

Which holds the RRset for the zone contents. This is grouped
together for DNSSEC purposes, but also helps in non-DNSSEC zones.
(There is of course a increase in memory usage).
2011-07-28 22:47:55 +02:00
Miek Gieben
b2a6356596 Fix opt pseudo section stuff 2011-07-25 11:24:26 +02:00
Miek Gieben
96ddebf335 add miek.nl.signed as a test zone
Add support for more RRs - I can now parse my own zone
2011-07-24 22:21:48 +02:00
Miek Gieben
00f8254ae1 Fix parsing of RRSIGs 2011-07-24 21:29:16 +02:00
Miek Gieben
c52f05f9f5 More error checking 2011-07-24 17:32:41 +02:00
Miek Gieben
4671072027 Error handling
Handle semantic errors in the input stream.
Try to use Ragel's error handling when seeing a non-supported
class. This does not work yet.
2011-07-24 17:08:33 +02:00
Miek Gieben
da0603089a gofmt -w 2011-07-23 23:43:43 +02:00
Miek Gieben
0dcfa0b427 Kill SetString
Create a NewRR that creates a new RR from a string.
FIx the tests to relfect this
2011-07-23 22:26:50 +02:00
Miek Gieben
a1a0034733 More Go like
Make a Parser type and define methods on that.
* Zone()    parse and return entire zone
* RR()      parse and return 1 RR
* PrivateKey parse a private key file
2011-07-22 23:51:30 +02:00
Miek Gieben
2a8d7f9694 Make the API more Go like 2011-07-22 23:28:04 +02:00
Miek Gieben
4f6b1f7ee2 Correct the count 2011-07-22 22:07:45 +02:00
Miek Gieben
c2a89d3184 Tweaks for parsing 2011-07-22 22:06:07 +02:00
Miek Gieben
7c716e66c0 Parsing zone files - does not work (yet) 2011-07-18 20:47:03 +02:00
Miek Gieben
e50100848c Fix parsing of AAAA records 2011-07-18 17:40:55 +02:00
Miek Gieben
e1bd7db73b More parsing tweaks 2011-07-18 16:06:06 +02:00
Miek Gieben
91b41d02bb SetString for DNSKEY and RRSIG 2011-07-18 15:49:20 +02:00
Miek Gieben
2eecc66477 SetString() for a bunch of RR - to be extended 2011-07-18 15:19:47 +02:00
Miek Gieben
fd0064c805 Parsings works - clean up the tests
RR_DNSKEY has now a
* Read (to read an RR)
* ReadPrivateKey (to read an private key file)

Together you have enough data to sign and verify DNSSEC data.
I'm thinking about a better API, but I think one will emerge
whenever I complete the zone parsin.
2011-07-17 20:51:27 +02:00
Miek Gieben
8c595abe56 More parsing stuff 2011-07-17 15:47:03 +02:00
Miek Gieben
43d51f7382 private key parsing works on files/io.Reader 2011-07-17 11:35:58 +02:00
Miek Gieben
fc96e3bfc5 Some tweaks. Next up: io.Reader to string for parsing 2011-07-15 18:09:41 +02:00
Miek Gieben
77df52c2f2 priv key parsing works also 2011-07-15 17:41:26 +02:00
Miek Gieben
981f1853bc First stab at parsing .priv key files with Ragel 2011-07-15 13:40:58 +02:00
Miek Gieben
6c4045c3a0 A add bunch of rr for parsing 2011-07-14 23:12:43 +02:00
Miek Gieben
77f4205cea I can parse rrs now 2011-07-14 21:25:15 +02:00
Miek Gieben
bd03eda9f4 Tweaks 2011-07-14 16:11:16 +02:00
Miek Gieben
3f9b67632a RSA priv key reading works again 2011-07-08 18:21:29 +02:00
Miek Gieben
5e18c6fb24 Very small tweaks/bugfixes 2011-03-24 15:52:37 +01:00
Miek Gieben
be6f2365cb Test compile again, but fail 2011-03-23 19:03:37 +01:00
Miek Gieben
369d06f1c7 Use line.Readline() 2011-03-23 18:53:16 +01:00
Miek Gieben
3af023bda9 Use bufio.Reader in private key reading 2011-03-23 16:10:15 +01:00
Miek Gieben
65acd06370 Quotes in txt records work 2011-02-21 21:32:12 +01:00
Miek Gieben
157c19af4b Fix real dots in domain names 2011-02-21 20:56:05 +01:00
Miek Gieben
c7c4d8061e Allow for escaping of dots in domainnames 2011-02-21 20:33:36 +01:00
Miek Gieben
983ccc7909 IPv6 works ago. Updated the tests 2011-02-21 18:23:39 +01:00
Miek Gieben
68e0e0b1be Set the algorithm too in the test 2011-01-18 11:34:48 +01:00
Miek Gieben
3df903d6e6 Small signing tweaks
* Get more info from the rrset your are signing
    * Still todo, calculate publickey and keytag etc.
2011-01-18 11:25:47 +01:00
Miek Gieben
96a55dee9b Less verbose tests 2011-01-17 20:29:40 +01:00
Miek Gieben
48cbf55a23 completely fix private key reading 2011-01-17 20:18:51 +01:00
Miek Gieben
1f6a221bd8 Private key completely works. Can read BIND9 files 2011-01-17 19:52:28 +01:00
Miek Gieben
74796c8672 Add SRV and NAPTR record support 2011-01-17 10:30:20 +01:00
Miek Gieben
79f61af370 Fix private Key reading (only for RSA atm) 2011-01-16 19:03:19 +01:00
Miek Gieben
2cfa45408d trying to set the pubkey from the private key 2011-01-16 18:37:29 +01:00
Miek Gieben
96457a435a Parsing .private files work - needs some cleaning up 2011-01-16 17:59:04 +01:00
Miek Gieben
317b23ceaf Parsing private key almost there 2011-01-16 17:43:41 +01:00
Miek Gieben
8ed6c8a8f4 more parsing: from private key file - not finished 2011-01-16 16:22:31 +01:00
Miek Gieben
e711d80acd better name 2011-01-15 22:54:11 +01:00