mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #2979] [MERGED] Separate encoder's handling of case and compression #3468
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#3468
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/2979
Author: @divergentdave
Created: 5/7/2025
Status: ✅ Merged
Merged: 5/13/2025
Merged by: @divergentdave
Base:
main← Head:david/encoder-flags📝 Commits (10+)
71813bdRemove no-op BinEncoder method3e49834Remove unused methodabe2199Replace canonical_names flag w/ name encoding enumf7b699dAdd setter and getter for name encoding mode2e8e68eAdd canonical form flag, set when encoding TBS5bc9625Use name encoding mode directlye1a5ed5Add ModalEncoder061d707Add method to switch name encoding mode for RDATA60b205bSet RDATA name encoding mode based on record type351f5c0Update signature-related encoder uses📊 Changes
23 files changed (+313 additions, -281 deletions)
View changed files
📝
crates/proto/src/dnssec/nsec3.rs(+4 -3)📝
crates/proto/src/dnssec/rdata/dnskey.rs(+2 -2)📝
crates/proto/src/dnssec/rdata/mod.rs(+11 -15)📝
crates/proto/src/dnssec/rdata/nsec.rs(+6 -5)📝
crates/proto/src/dnssec/rdata/sig.rs(+9 -8)📝
crates/proto/src/dnssec/rdata/tsig.rs(+23 -18)📝
crates/proto/src/dnssec/tbs.rs(+12 -3)📝
crates/proto/src/op/header.rs(+0 -2)📝
crates/proto/src/rr/domain/name.rs(+64 -87)📝
crates/proto/src/rr/lower_name.rs(+1 -13)📝
crates/proto/src/rr/rdata/caa.rs(+1 -0)📝
crates/proto/src/rr/rdata/cert.rs(+2 -1)📝
crates/proto/src/rr/rdata/mx.rs(+3 -4)📝
crates/proto/src/rr/rdata/name.rs(+8 -60)📝
crates/proto/src/rr/rdata/naptr.rs(+5 -3)📝
crates/proto/src/rr/rdata/opt.rs(+5 -2)📝
crates/proto/src/rr/rdata/soa.rs(+4 -7)📝
crates/proto/src/rr/rdata/srv.rs(+3 -6)📝
crates/proto/src/rr/rdata/svcb.rs(+7 -5)📝
crates/proto/src/rr/record_data.rs(+8 -10)...and 3 more files
📄 Description
This reimplements name handling modes in the encoder. The existing canonical names flag is replaced with three different flags, that indicate whether canonical form is being used, whether names should be encoded in compressed form, and whether names should be transformed to lowercase before encoding. The canonical form flag is used to communicate from the ultimate caller to the RData enums, and indicate whether the normal rules or canonical form rules should be used. There, the other two flags are temporarily set before encoding the RDATA, and affect the behavior of
Name::emit(). There are three different combinations of behavior for names within RDATA, depending on the record type. I cleaned up some other uses of flags and specialized emit methods elsewhere, to centralize canonical form handling in the RData enums. Note that some record types do not require changing encoder flags at all, because they do not contain any domain names in their RDATA.Closes #2934.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.