Commons Codec
  1. Commons Codec
  2. CODEC-172

Base32 decode table has spurious value

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.9
    • Labels:
      None
    • Environment:

      Any

      Description

      The Base32.DECODE_TABLE array contains the value 63 at pos 41:
      ...
      -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, // 20-2f
      ...

      I think this is a mistake because this value is not found in RFC-4648? It looks like a copy-paste error from Base64.

        Activity

        Sebb made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Sebb [ sebb@apache.org ]
        Fix Version/s 1.9 [ 12324374 ]
        Resolution Fixed [ 1 ]
        Hide
        Sebb added a comment -

        The same problem affected the HEX table.
        Also there were several references to Table 3 in RFC 2045; that is actually in RFC 4648

        URL: http://svn.apache.org/r1488493
        Log:
        CODEC-170 Base32 decode table has spurious value

        Modified:
        commons/proper/codec/trunk/src/changes/changes.xml
        commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base32.java

        Show
        Sebb added a comment - The same problem affected the HEX table. Also there were several references to Table 3 in RFC 2045; that is actually in RFC 4648 URL: http://svn.apache.org/r1488493 Log: CODEC-170 Base32 decode table has spurious value Modified: commons/proper/codec/trunk/src/changes/changes.xml commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base32.java
        Hide
        Sebb added a comment -

        0x2f is '/' which is indeed 63 in Base 64 - and is not valid in Base 32.
        The code was originally copied from Base64.java, so you are correct; good catch.

        Show
        Sebb added a comment - 0x2f is '/' which is indeed 63 in Base 64 - and is not valid in Base 32. The code was originally copied from Base64.java, so you are correct; good catch.
        Sebb made changes -
        Field Original Value New Value
        Assignee Sebb [ sebb@apache.org ]
        Matt Bishop created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Matt Bishop
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development