Uploaded image for project: 'WSS4J'
  1. WSS4J
  2. WSS-566

AES_128_GCM does not work for attachments

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.7, 2.1.5
    • Component/s: WSS4J Core
    • Labels:
      None

      Description

      When trying use stax APIs to encrypt and decrypt attachments using AES_GCM_128, it breaks with error saying
      Caused by: java.lang.IllegalStateException: Cipher not initialized
      at javax.crypto.Cipher.d(Unknown Source)
      at javax.crypto.Cipher.doFinal(Unknown Source)
      at javax.crypto.CipherInputStream.close(Unknown Source)

      Please note that same code works for AES_128 with attachments.

      Also, I looked into the code stax code, found that org.apache.xml.security.stax.impl.processor.input.AbstractDecryptInputProcessor.processEvent(InputProcessorChain, boolean) has

      final int ivLength = JCEAlgorithmMapper.getIVLengthFromURI(algorithmURI) / 8;

      Not sure if ivLength used for GCM could be the problem?

        Attachments

        1. graycol.gif
          0.1 kB
          Namrata Jaiswal
        2. graycol.gif
          0.1 kB
          Namrata Jaiswal
        3. graycol.gif
          0.1 kB
          Namrata Jaiswal
        4. graycol.gif
          0.1 kB
          Namrata Jaiswal

          Activity

            People

            • Assignee:
              coheigea Colm O hEigeartaigh
              Reporter:
              namrata Namrata Jaiswal
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: