Uploaded image for project: 'Santuario'
  1. Santuario
  2. SANTUARIO-494

Do not include carriage return character (
 or 
) in base64-encoded fields in XML signature

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • Java 2.1.2
    • None
    • Java
    • None
    • Patch

    Description

      In Santuario 2.1.0 there was a switch to use the java.util.Base64 Mime Encoder.

      Unfortunately this encoder uses \r\n as end-of-line terminator.

      So resulting XML includes escaped \r character, encoded as 
 or  
 for example:

      <ds:DigestValue>jFHKh16UIYL+MslahIe06VpUW+Q9uyC/9vvsKiYHalqMwsyN7PChFbeMn0Cg+AAAeJqTgBYdVS+R&#xd;
      vpef7TWwJA==</ds:DigestValue>

      Apart from being non-pretty it imposes problems in some use cases, for example see https://issues.jboss.org/browse/WFLY-9892

      It's better to use \n as end-of-line terminator.

      Attaching a patch for this issue.

      Attachments

        1. base64-no-carriage-return.patch
          2 kB
          Mikhail Ryagin

        Issue Links

          Activity

            People

              coheigea Colm O hEigeartaigh
              ryagin Mikhail Ryagin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: