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

XML Signature performance issue caused by unbuffered signature data

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8, 9
    • Fix Version/s: 9
    • Component/s: security-libs
    • Labels:

      Backports

        Description

        Serious performance issue, bug was initially filed against Apache Santuario.
        From https://issues.apache.org/jira/browse/SANTUARIO-393 :

        After upgrading from xmlsec (java) 1.4 to 1.5 we saw a significant drop
        in signature generation performance especially when using a network
        based HSM.

        After some investigation it turns out that the problem is that the
        hashing is done with one byte at a time which with network latencies
        gives the bad performance.

        Looking in the code of DOMSignedInfo.java it looks like the code intends
        to use an UnsyncBufferedOutputStream however only its close method is
        actually called, which as far as I can see won't have any side affect at
        all when operated on a ByteArrayOutputStream.

        The attached patch resolves the performance issue by actually using the
        UnsyncBufferedOutputStream and that way perform the digests on a
        possibly full buffer instead of byte by byte. The patch has been tested
        on version 1.5.5 but also applies on 1.5.6.

          Activity

          mullan Sean Mullan created issue -
          mullan Sean Mullan made changes -
          Field Original Value New Value
          Status New [ 10000 ] Open [ 1 ]
          mullan Sean Mullan made changes -
          Fix Version/s tbd_minor [ 11999 ]
          mullan Sean Mullan made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Understanding Fix Understood [ 10001 ]
          mullan Sean Mullan made changes -
          Summary XML Signature performance issue as signature data is not buffered XML Signature performance issue caused by unbuffered signature data
          mullan Sean Mullan made changes -
          Labels noreg-perf
          hgupdate HG Updates made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Understanding Fix Understood [ 10001 ]
          Resolved In Build team [ 17324 ]
          Fix Version/s 9 [ 14949 ]
          Fix Version/s tbd_minor [ 11999 ]
          Resolution Fixed [ 1 ]
          hgupdate HG Updates made changes -
          Link This issue backported by JDK-8050000 [ JDK-8050000 ]
          hgupdate HG Updates made changes -
          Resolved In Build team [ 17324 ] master [ 18256 ]
          hgupdate HG Updates made changes -
          Resolved In Build master [ 18256 ] b23 [ 17433 ]
          hgupdate HG Updates made changes -
          Link This issue backported by JDK-8063742 [ JDK-8063742 ]
          hgupdate HG Updates made changes -
          Link This issue backported by JDK-8070193 [ JDK-8070193 ]
          jibiche Jibing Chen (Inactive) made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          hgupdate HG Updates made changes -
          Link This issue backported by JDK-8175440 [ JDK-8175440 ]

            People

            • Assignee:
              mullan Sean Mullan
              Reporter:
              mullan Sean Mullan
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: