Commit Graph

3074 Commits

Author SHA1 Message Date
Andrew Tunnell-Jones 022d2d4a01 Lose a loop in Msg.RemoveRRset() and use copyHeader()
Per @miekg's advice
2014-11-12 09:54:56 +00:00
Andrew Tunnell-Jones 104b206d2c Make RemoveRRset work as intended 2014-11-12 07:57:16 +00:00
Andrew Tunnell-Jones ffe24e63af Test that Msg.RemoveRRset() works as intended 2014-11-12 07:57:04 +00:00
Andrew Tunnell-Jones 71436daebe Make TestDynamicUpdateZeroRdataUnpack pass
Straight up: took a guess and the tests pass.
2014-11-12 07:56:21 +00:00
Andrew Tunnell-Jones 414013f99f Add test covering unpacking 0-length rdatas 2014-11-12 07:46:11 +00:00
Miek Gieben 6e3a9dd0d8 Fix tsig fudge factor
Excellent bug report from freb, about how this fails when a message
arrives in the past (because of clock skew).

Closes #153
2014-11-11 17:58:12 +00:00
Miek Gieben 34f43d398b Stop parsing when hitting rdlen
Stop parsing these records when we hit rdlen.
2014-11-09 16:17:06 +00:00
Miek Gieben 11bbb59419 Rename rdlen to lenrd
More in sync with lenmsg.
2014-11-09 16:16:41 +00:00
Miek Gieben d33af8db79 Update test and gofmt 2014-11-09 16:09:49 +00:00
Miek Gieben 7619917e11 Add Test for dynamic unpack failure 2014-11-09 10:04:46 +00:00
Miek Gieben 20e762df62 And add testing 2014-11-09 09:57:06 +00:00
Miek Gieben a8bb44f5e5 Move tests and start update_test.go
Put the update tests in a seperate file.
2014-11-09 09:56:22 +00:00
Miek Gieben eff0e9354f Apply 433ab7b569 here too
The same Sprintf was used here, so this can be optimized as well.

Thanks to @andrewtj for the ping.
2014-11-09 08:03:03 +00:00
Miek Gieben a829f4a296 Merge pull request #149 from DanielMorsing/unprintable
Reduce amount of work done when unpacking unprintable characters.
2014-11-06 13:58:16 +00:00
Daniel Morsing 433ab7b569 Reduce amount of work done when unpacking unprintable characters.
Instead of going through the fmt package, we can use append int,
which saves an allocation.

benchmark                                old ns/op     new ns/op     delta
BenchmarkUnpackDomainNameUnprintable     2147          506           -76.43%
2014-11-06 13:51:29 +00:00
Miek Gieben d92b230e89 fix buffer overrun in unpack() 2014-11-04 20:17:43 +00:00
Miek Gieben 3a660df5ae Merge branch 'andrewtj-atj-sig0' 2014-11-03 11:04:36 +00:00
Miek Gieben 26e298191a Fix package header 2014-11-03 11:04:21 +00:00
Miek Gieben a34d1f6ad7 Merge branch 'master' of github.com:miekg/dns 2014-11-03 11:02:31 +00:00
Miek Gieben 241f9e6ce5 There is a copyright file now 2014-11-03 08:04:16 +00:00
Andrew Tunnell-Jones 9862d7044a SIG0 misc - doc, bounds checking, refactor tests
* expand documentation a little and tweak comments
* add bounds checking in Verify()
* refactor tests
2014-11-02 23:20:08 +00:00
Miek Gieben 53a0935749 Documentation cleanups 2014-11-02 11:39:12 +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
Miek Gieben 678d31fa77 Merge branch 'master' of github.com:miekg/dns 2014-11-02 11:12:07 +00:00
Miek Gieben d2c3cd6b0b Merge pull request #144 from andrewtj/atj-sig0
SIG(0)
2014-11-02 11:11:46 +00:00
Miek Gieben a945149fab Print unknown record type with CLASSX and TYPEX
When printing unknown records it is best to print the entire thing
as unknown, instead of relying on the internal defined type. An
example A record, printed as an unknown one:
    miek.nl.      3600    CLASS1  TYPE1   \# 4 0a000101
2014-11-02 11:06:05 +00:00
Andrew Tunnell-Jones bc85c128bd Test SIG(0)
Tests message signing and verification against
itself, that altered messages don't pass and that
expired messages don't pass.

Static samples generated by something else would
be good to add at some point.
2014-11-02 00:28:01 +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
Andrew Tunnell-Jones 5bccac1c47 Fix off-by-one error parsing DSA public key
I ran into a slice bounds out of range panic. Tired so I just rewrote it.
2014-11-01 10:54:01 +00:00
Miek Gieben a50b50cd89 Merge branch 'master' of github.com:miekg/dns 2014-10-30 13:44:26 +00:00
Miek Gieben 6bbae6c6ea Add CDNSKEY support 2014-10-23 22:18:23 +01:00
Miek Gieben 71466895f7 Remove ECC which was set as alg 4
There is no alg 4 and ECC is not an algorithm identifier.
2014-10-23 08:12:02 +00:00
Miek Gieben 6c47bdacd8 Merge pull request #142 from axaxs/master
DNSSEC algorithm and digest types now uint8
2014-10-23 09:07:24 +01:00
Alex A Skinner c417e9729d DNSSEC algorithm and digest types now uint8 2014-10-22 20:41:03 -04:00
Miek Gieben 467e368cc1 check for overflowing msg len when unpacking A
unclebadtouches catched this.

closes #141
2014-10-22 21:08:34 +01:00
Miek Gieben d8da4d2fa7 Fix: drop requests with *cough* qr set.
Err, yeah.
2014-10-19 09:36:26 +00:00
Miek Gieben 6b75215519 Merge pull request #137 from asergeyev/master
LOC typeToParserFunc fix and mnemonics for CERT rr
2014-10-08 17:50:57 +01:00
Miek Gieben 3d0face066 Fixup tests 2014-10-08 14:35:23 +00:00
Miek Gieben de954625b6 Add ErrExtendedRcode and fix up the callers 2014-10-08 14:31:28 +00:00
Miek Gieben 089554ccd1 Rename to ExtendedRcode and fix a comment 2014-10-08 14:29:46 +00:00
Miek Gieben df37bb6f5d Merge branch 'master' of github.com:miekg/dns 2014-10-08 14:28:31 +00:00
Miek Gieben af1ec6e545 Merge pull request #135 from FiloSottile/ext_rcode
Add support for extended RCODEs and detect bad RCODEs
2014-10-08 15:28:22 +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
Miek Gieben 06e7420b3e Merge branch 'master' of github.com:miekg/dns 2014-10-06 10:58:03 +00:00
Miek Gieben ce9b1fdbf8 Add TODOs 2014-10-06 10:57:49 +00:00
Miek Gieben d05369e629 tests: remove parse_test.db
Make it an string inside the test file and use strings.NewReader.
2014-10-06 07:45:31 +01:00
Filippo Valsorda 9088298b2b Add support for extended RCODEs and detect bad RCODEs 2014-09-26 12:18:36 +01:00
Miek Gieben c12ae078ae Merge pull request #134 from asergeyev/master
Attempting to fix #133
2014-09-24 14:15:31 +01:00
Miek Gieben 2cc86b011d Merge pull request #132 from FiloSottile/fix_OPT
Fix the OPT RR Version get code and simplify DO get/set
2014-09-24 11:42:48 +01:00