-
-
Notifications
You must be signed in to change notification settings - Fork 64
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 a bug in dname scanning #240
Conversation
Thank you for the PR! Do you think it would be worthwhile to add your case to the test zonefiles in test-data? |
My zone file is as simple as below, and I don't think it will be helpful to cover the issue. I got hit when trying to decode the message on another host. That's why the compose/parse step was added to the test case. On the other hand, I'd like to ditch the
|
The unchecked calls are there because the code is supposed to produce a validly encoded domain name and so there can’t be an error. I don’t yet quite understand what’s going wrong here and, sadly, didn’t have time today to dig into it. Hopefully, tomorrow … |
I should have written it clearly in the beginning. Let me try to explain. In To fix it, Footnotes |
What seems to happen is that the NS record’s rdlength is off by one – the name itself is correct. I haven’t figured out yet why, but I would rather fix that issue than work around it. |
Figured it out – the fix is in 9e7907c I’d still would like to incorporate your compose/parse cycle test, so maybe we should keep both the fix and test in here, which would mean you’d need to adjust your branch. I’m also happy to do all of it in a new PR, whatever way you prefer. One note for the test: I think it might be good to not exclude the |
The PR has been update. I also updated the unknown test case, as it is supposed to have valid rdata. |
Thank you! Looking good now. I suppose we have enough now to make a release as well. |
New * Removed the `Sized` bound for octets types used by the `tsig` module. ([#241] by [@torin-carey]) * Added an impl for `AsRef<Message<[u8]>>` for any message. ([#242] by [@torin-carey]) Bug fixes * Fixed in scanning absolute domain names from a zonefile that resulted in illegal wire data being produced. ([#240] by [@xofyarg)]
A illegal octets was put into Dname, e.g. b"\x03com\x2e", with no check. Composing the name later results malformed message.
Also add a test to convert the zonefile record back and forth to wire format.