-
Notifications
You must be signed in to change notification settings - Fork 522
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
NSEC generation support #905
Conversation
#906 should be merged first if desired (or just close it and merge this one) |
Hi @jschlyter, I think there are a couple of problems with this. First, the logic in
Second, the reason for I'm not sure that I see the benefit of doing multiple iterations, one to exclude glue and one to actually generate the NSECs; why not iterate once, and at each node, skip it if it's glue, set the current delegation if appropriate, and add the NSEC if it's appropriate? |
add test example with delegation below other delegation
The current code is not adding NSEC to the bitmap, but it should per RFC 4035 section 2.3. |
Also, I've got a PR open that will allow iteration of the zone inside of the transaction, as the way of doing it with the released API is clunky. (It's best to do everything transactionally when doing transactions.) |
Fixed in e067703 |
I'll test that. |
Also make rdataset iteration more obvious by adding an explicit iterate_rdatasets() API.
Don't worry about the codeql error on this one, that was my fault when I was removing curio as I missed a reference to it |
@bwelling single iteration fixed now |
Definitely looks better; thanks. Before this is merged, though, it might be worth a bit more thought about whether this is the right API. The main reason to add NSECs to a zone is when signing the zone. With this API, signing the zone would involve calling I think what I'm mostly trying to say is that if the goal is to have a way to sign a zone, I don't think there should be a separate API for adding NSEC records; it should just be part of the signing. If the goal is to incrementally add signing, I think this is a good step, but I would rather see this folded into a more comprehensive signing API between now and the next release, rather than be a permanent API on its own. That doesn't mean that this change couldn't be committed now; just that I don't think it should be released in its current state. The one change I would like to see before this is committed at all is to allow a (writable) transaction to be passed in, so that the process of adding NSEC records is not required to be the only change in the zone version. If the caller passed |
@bwelling I agree, I'll take a look at the context issue. For signing, we could pass an optional function to apply to all secure names. Such a function, which could be a partial function, would be passed the context and the node and can choose what signatures to create. Would that be a way forward? |
Some ideas in #904 (comment) |
The changes to add signing are a valid technical solution, but they don't answer the real questions I had.
The I'm bringing this up because once an API is added (and released), we're stuck with it. If the more common operation is "sign a zone", then it would be better overall to have an API for that, and not be stuck with an API for "add NSEC records with a callback for signing". |
I'll move this discussion to #909, a PR might not be the best place to sort this out. |
Add function for NSEC generation:
dns.dnssec.add_nsec_to_zone()
. Finding all secure names are implemented in a separate function as it might be useful for NSEC3 if implemented later.