alexdalitz / dnsruby

Dnsruby is a feature-complete DNS(SEC) client for Ruby, as used by many of the world's largest DNS registries and the OpenDNSSEC project
Other
194 stars 77 forks source link

Fix create name include url special characters #161

Closed mimuret closed 4 years ago

mimuret commented 4 years ago
["hoge/hoge","hoge#hoge","hoge?hoge"].each do |d|
  pp "input #{d}"
  pp "output #{Dnsruby::Name.create(d)}"
end
"input hoge/hoge"
"output hoge"
"input hoge#hoge"
"output hoge"
"input hoge?hoge"
"output hoge"
keithrbennett commented 4 years ago

@mimuret Thank you for this PR. I noticed that the gem you are using, simpleidn (https://github.com/mmriis/simpleidn) is not yet at version 1 and says it does not preserve case. @alexdalitz Is this a problem?

alexdalitz commented 4 years ago

Hi @mimuret -

Thanks for the patch!

I agree that your tests seem valid, and that the current IDN support in dnsruby seems to be failing here.

However, I'm a little concerned about the non-preservation of case. Although I accept that case does not matter in a pure DNS view, it is also the case that case preservation is a useful part of anti-spoofing defenses. In the ideal world, we would preserve the case that the client asked for.

Do you have any thoughts on this, please?

Thanks!

Alex.

alexdalitz commented 4 years ago

Ok, I guess this is a moot point, as Dnsruby downcases all labels anyway...

mimuret commented 4 years ago

RFC5890 describe,

A-labels should be produced only in lowercase

Already dnsruby can't save case-sensitive.

We choose case-sensitive or IDN support.

I like case-sensitive.