-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix root server proofs #76
Conversation
015b29d
to
e2600b7
Compare
Adds an NSEC record to indicate that we only have NS NSEC RRSIG. This proves that we don't have a DS rr and allows unbound to treat the zone as unsigned.
55859a7
to
b28d783
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice work! Only minor issues so far otherwise mostly nits
Packet error when sending an NX label with length 63 +dnssec
more details in review comments.
dig @127.0.0.1 -p 5349 dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddda NS +dnssec
;; Got bad packet: FORMERR
516 bytes
e4 16 85 03 00 01 00 00 00 06 00 01 3f 64 64 64 ............?ddd
64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 dddddddddddddddd
64 64 64 64 64 64 64 64 64 64 64 61 00 00 02 00 ddddddddddda....
01 3f 64 64 64 64 64 64 64 64 64 64 64 64 64 64 .?dddddddddddddd
Also qname mismatch with dirty names:
dig @127.0.0.1 -p 5349 foobar\\255
;; ;; Question section mismatch: got foobar\000/A/IN
rebase to a2e546f
|
rebase to d5adee6
|
Regarding this, it is actually only an issue if the byte code is Lines 2136 to 2144 in b3e1f6f
Lines 2276 to 2282 in b3e1f6f
In both cases, hnsd will still send a REFUSED so at least we are protected the same way hsd is. As far as the qname mismatch, I don't know how important that is to get exactly right in this edge case. I ran a somewhat annoying bash loop:
...and with this output I verified that /254 and /255 were the only anomalies. Byte codes in the ASCII range get the usual NX response with the new NSEC proofs because our "dirty" test doesn't check for every special character but it does cover slashes, which is the most relevant for us. I'm still trying to figure out what that dirty test is specifically for. I moved it out of name-writing and name-serializing and just use it to test input now when a request is made, I hope that isnt a mistake. |
src/ns.c
Outdated
char next[HSK_DNS_MAX_NAME] = "\\000."; | ||
memcpy(&next[5], req->name, strlen(req->name)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I be using strcat()
for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hsk_rs_log(ns, " why_bogus: %s\n", result->why_bogus); | ||
goto fail; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a check for the CD bit in the request here. If it's set then return the response as is even if bogus.
dig @hnsd-recursive dnssec-failed.org
SERVFAIL
dig @hnsd-recursive dnssec-failed.org +cd
dnssec-failed.org. 7200 IN A 69.252.80.75
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9acb1d8
to
430db04
Compare
Converting this to draft: I'm going to break it up into 3-4 smaller PRs to facilitate review ;-) |
Closing this monster now, it has been sliced into 4 other PRs. I combined those 4 PRs back in to one branch to make sure all the tests still pass in the end: pinheadmz#4 |
Closes #21
Closes #42 (actually builds off these commits)
Requires (rebased on) #68 for testsPort of handshake-org/hsd#593
This should cover everything in the hsd PR and a few extra bug fixes in hnsd:
also:
Testing:
I launched hsd in regtest mode like so:
Then executed my "regtest names" script which runs auctions and adds combinations of DNS records to the root zone:
https://gist.github.com/pinheadmz/49e3fac7d797a99c3a78fb3ca0ddc012
These data are already included in the hnsd tests in
test/data/resource_vectors.h
but this also gives an easy way to compare side-by-side the answers from hsd vs hnsd.Build hnsd and connect to hsd like this:
e.g.