Uploaded image for project: 'EJBCA'
  1. EJBCA
  2. ECA-9170

SecureXmlDecoder cannot deserialize enums created in Java 6

    Details

    • Issue discovered during:
      Customer

      Description

      SecureXmlDecoder cannot deserialize enums created in Java 6

      This affects the PublisherData table and possibly CAData.

      Workaround:
      For PublisherData it is possible to workaround by deleting the publisher from database and re-creating it (and selecting it again in profiles etc.)

      It is not yet known if there is an upgrade path that affects CAData (i.e. if there is an EJBCA version that had enums in CAData and also supported Java 6). For CAData it could be more difficult to work around.

      Technical details
      The encoding is slightly different in Java 6 compared to later versions (XmlEnc$TestEnum is the enum class, BBBB is the enum value)

      <java version="1.6.0_45" class="java.beans.XMLDecoder"> 
       <object class="java.util.HashMap"> 
        <void method="put"> 
         <string>KEY1</string> 
         <object class="XmlEnc$TestEnum" method="valueOf">
          <string>BBBB</string> 
         </object> 
        </void> 
       </object> 
      </java>
      
      <?xml version="1.0" encoding="UTF-8"?>
      <java version="1.7.0_201" class="java.beans.XMLDecoder">
       <object class="java.util.HashMap">
        <void method="put">
         <string>KEY1</string>
         <object class="java.lang.Enum" method="valueOf">
          <class>XmlEnc$TestEnum</class>
          <string>BBBB</string>
         </object>
        </void>
       </object>
      </java>
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              samuel Samuel Lidén Borell
              Reporter:
              samuel Samuel Lidén Borell
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 days
                  2d
                  Remaining:
                  Remaining Estimate - 2 days
                  2d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified