zonemaster / zonemaster-ldns

A Perl interface module for Zonemaster to NLnet Labs' ldns library
Other
8 stars 12 forks source link

Libidn2 backward compatible with IDNA2003 #150

Closed ghost closed 7 months ago

ghost commented 2 years ago

Purpose

With the libidn2 migration and the IDNA2008 mappings, Zonemaster can't test a domain with a symbol if it is not given in its encoded form (try for instance with šŸ‘.example and xn--yp8h.example).

Even though ICANN agreed that it is ok to prevent symbol mappings in IDNA2008, emoji domains exist (see for instance https://iā¤ļø.ws/). Therefore it would be nice if Zonemaster could automatically encode the domain and test it.

Context

n/a

Changes

Following recommendations in libidn2 manual, the to_idn() method is updated to be IDNA2003 compatible.

How to test this PR

A unit test is added. This PR can also be manually tested, perl -MZonemaster::LDNS -MEncode -e 'Zonemaster::LDNS::to_idn( decode_utf8( "šŸ‘.tld" ) )' sould not give any error.

credits to @blacksponge for spotting this

matsduf commented 2 years ago

I have two objections to this PR:

  1. If such a change should be introduced, it should start with the specification. There is already a proposed specification in progress in https://github.com/zonemaster/zonemaster/pull/942 that has been discussed, and which the WG has agreed on (in general terms). This PR is in conflict with that specification.
  2. Domains with emoji are odd cases and not compatible with IDNA 2008. Supporting testing such domain names by A-label requires no changes to specification or code, but supporting testing by U-label increases the complexity of both specification and code.
mattias-p commented 2 years ago

I agree with @matsduf. The implementation is simpler if IDNs are normalized to A-labels internally. E.g. the cache layer needs to work with normalized domain names anyway.

matsduf commented 2 years ago

Put on hold until specification has been updated (or at least proposal). An issue will be created in zonemaster/zonemaster.