Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7024604

OID.1 causes IAE in X500Principal constructor

    XMLWordPrintable

Details

    • b27
    • x86
    • linux
    • Verified

    Description

      Spec for X500Principal constructor says:

      ----------------------------------8<----------------------------------------------
      public X500Principal(String name)

          Creates an X500Principal from a string representation of an X.500 distinguished name (ex: "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US"). The distinguished name must be specified using the grammar defined in RFC 1779 or RFC 2253 (either format is acceptable).

          This constructor recognizes the attribute type keywords defined in RFC 1779 and RFC 2253 (and listed in getName(String format)), as well as the T, DNQ or DNQUALIFIER, SURNAME, GIVENNAME, INITIALS, GENERATION, EMAILADDRESS, and SERIALNUMBER keywords whose OIDs are defined in RFC 2459 and its successor. Any other attribute type must be specified as an OID.

          Parameters:
              name - an X.500 distinguished name in RFC 1779 or RFC 2253 format
          Throws:
              NullPointerException - if the name is null
              IllegalArgumentException - if the name is improperly specified
      ----------------------------------8<----------------------------------------------

      BNF provided in RFC 1779 allows OID to contain only one number:

      --------------------8<-------------------------------
        <oid> ::= <digitstring> | <digitstring> "." <oid>
        <digitstring> ::= 1*<digit>
        <digit> ::= digits 0-9
      --------------------8<-------------------------------

      The same is true for RFC 2253

      So following constructor:

      new X500Principal("OID.1=value")

      must not cause IAE to be thrown.

      However IAE is thrown on JDK 6.

      Note that it is not thrown in following case:

      new X500Principal("OID.1.2=value")

      Attachments

        Activity

          People

            mullan Sean Mullan
            sreznick Sergey Reznick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: