Skip to content
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

CanonicalName case folding of non-US-ASCII letters #1434

Closed
zeroizerz opened this issue Mar 12, 2023 · 0 comments · Fixed by #1470
Closed

CanonicalName case folding of non-US-ASCII letters #1434

zeroizerz opened this issue Mar 12, 2023 · 0 comments · Fixed by #1470

Comments

@zeroizerz
Copy link

https://www.rfc-editor.org/rfc/rfc4034#section-6.2:

all uppercase US-ASCII letters in the owner name of the RR are replaced by the corresponding lowercase US-ASCII letters

Currently the CanonicalName function is implemented using strings.ToLower, which lowercases both US-ASCII and non-US-ASCII letters. But only US-ASCII letters should be lowercased according to the RFC.

This is further corroborated by https://www.rfc-editor.org/rfc/rfc4343#section-3:

Note that the DNS case insensitivity does NOT correspond to the case folding specified in [ISO-8859-1] or [ISO-8859-2]. For example, the octets 0xDD (\221) and 0xFD (\253) do NOT match, although in other contexts, where they are interpreted as the upper- and lower-case version of "Y" with an acute accent, they might.

Accordingly, dns.CanonicalName("ÉxamplE.com") should output Éxample.com., but currently outputs éxample.com..

retornam added a commit to retornam/dns that referenced this issue Jul 2, 2023
According to Section 6.2 [1] of RFC 4034,
all uppercase US-ASCII letters in the owner name
of the RR are replaced by the corresponding lowercase
US-ASCII letters.

I updated the CanonicalName function to conform to
the RFC and updated its tests too.

[1] https://www.rfc-editor.org/rfc/rfc4034#section-6.2

Fixes miekg#1434
retornam added a commit to retornam/dns that referenced this issue Jul 2, 2023
According to Section 6.2 [1] of RFC 4034,all uppercase US-ASCII letters in the
owner name of the RR are replaced by the corresponding lowercase US-ASCII
letters.

This updates CanonicalName to conform to the RFC.

[1] https://www.rfc-editor.org/rfc/rfc4034#section-6.2

Fixes miekg#1434
miekg pushed a commit that referenced this issue Sep 12, 2023
According to Section 6.2 [1] of RFC 4034,all uppercase US-ASCII letters in the
owner name of the RR are replaced by the corresponding lowercase US-ASCII
letters.

This updates CanonicalName to conform to the RFC.

[1] https://www.rfc-editor.org/rfc/rfc4034#section-6.2

Fixes #1434
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant