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

Decryption fails with cipher not initialized error when multiple attachmments are used

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.7
    • Fix Version/s: None
    • Component/s: WSS4J Core
    • Labels:
      None

      Description

      When multiple attachments are used for decrypting using Stax Apis in WSS4j, decryption does not work

      The decryption works fine for 1st attachment (I can see that javax.security.auth.callback.CallbackHandler#handle(javax.security.auth.callback.Callback[]) API for both AttachmentRequestCallback and AttachmentResultCallback are invoked for first attachment and also AttachmentResultCallback returned decrypted the data )but it breaks with error Cipher not initialized for second attachment. For 2nd attachment, AttachmentRequestCallback goes fine where we set everything but handle call for AttachmentResultCallback breaks with error Cipher not initialized (before invoking password callbacks) when we try to read decrypted data.

      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)

        Attachments

        1. graycol.gif
          0.1 kB
          Namrata Jaiswal
        2. logs.txt
          70 kB
          Namrata Jaiswal
        3. graycol.gif
          0.1 kB
          Namrata Jaiswal
        4. graycol.gif
          0.1 kB
          Namrata Jaiswal
        5. input.xml
          10 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: