[GH-ISSUE #3202] NSEC3 validation cleanup #1153

Open
opened 2026-03-16 01:44:38 +03:00 by kerem · 1 comment
Owner

Originally created by @divergentdave on GitHub (Aug 13, 2025).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/3202

  • Gracefully handle cases where a wildcard name would exceed 255 bytes. I think that for closest encloser names that are 254 or 255 bytes, we can probably assume that a wildcard does not exist. The alternate way to approach this would be to avoid the Name type when computing hashes of wildcard names to sidestep this length restriction.
  • We can eliminate the unreachable branch in closest_encloser_proof() by re-ordering the Some((0, _)) and Some((i, _)) if i > 0 branches.
  • We could remove uses of swap_remove() and make some variables immutable by hoisting the call to build_encloser_candidates_list() out of closest_encloser_proofs(), passing a reference to the list in, and only using references for these candidates.
Originally created by @divergentdave on GitHub (Aug 13, 2025). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/3202 - [ ] Gracefully handle cases where a wildcard name would exceed 255 bytes. I think that for closest encloser names that are 254 or 255 bytes, we can probably assume that a wildcard does not exist. The alternate way to approach this would be to avoid the `Name` type when computing hashes of wildcard names to sidestep this length restriction. - [x] We can eliminate the unreachable branch in `closest_encloser_proof()` by re-ordering the `Some((0, _))` and `Some((i, _)) if i > 0` branches. - [ ] We could remove uses of `swap_remove()` and make some variables immutable by hoisting the call to `build_encloser_candidates_list()` out of `closest_encloser_proofs()`, passing a reference to the list in, and only using references for these candidates.
Author
Owner

@djc commented on GitHub (Aug 16, 2025):

  • We can eliminate the unreachable branch in closest_encloser_proof() by re-ordering the Some((0, _)) and Some((i, _)) if i > 0 branches.

Took care of this in

<!-- gh-comment-id:3193661635 --> @djc commented on GitHub (Aug 16, 2025): > * We can eliminate the unreachable branch in `closest_encloser_proof()` by re-ordering the `Some((0, _))` and `Some((i, _)) if i > 0` branches. Took care of this in - #3208
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#1153
No description provided.