Uploaded image for project: 'WildFly Elytron'
  1. WildFly Elytron
  2. ELY-47

NFKC normalization in StringPrep is not in accordance with RFC

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • None
    • None

      StringPrep from utils use java.text.Normalizer to NFKC normalization. But this normalization is not in accordance with RFC 3454 - see mapping table:
      http://tools.ietf.org/html/rfc3454#appendix-B.2

      Relevant profile description:
      http://tools.ietf.org/html/rfc3454#section-3.2

      Full test is part of pull request 13, but for basic testing can be used this simple test:

          @Test
          public void testNormalizationWithNFKC(){
              ByteStringBuilder b = new ByteStringBuilder();
      
              String before = "\u0041\u0042\u0043\u0044\u0045\u0046\u0047";
              String after =  "\u0061\u0062\u0063\u0064\u0065\u0066\u0067";
      
              StringPrep.encode(before, b, StringPrep.NORMALIZE_KC);
              assertEquals(after, new String(b.toArray()));
          }
      

              darran.lofthouse@redhat.com Darran Lofthouse
              jkalina@redhat.com Jan Kalina (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: