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

JUnit test XMLEncryption11Test.testAESGCMAuthentication() for StAX API fails sometimes

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Java 2.0.0
    • Fix Version/s: Java 2.0.1
    • Component/s: Java
    • Labels:
      None

      Description

      I have downloaded the latest Java 2.0.0 release and tried to build it. The build failed during the testing phase with the message:
      XMLEncryption11Test.testAESGCMAuthentication:441->Assert.fail:88 Exception expected
      in org.apache.xml.security.test.stax.encryption.XMLEncryption11Test.

      I have tried adding some debug logging, and one of the subsequent builds succeeded - with no essential code changes - which is an indication of a race condition happening.

      It appears that the test expects to get the exception:
      java.io.IOException: javax.crypto.BadPaddingException: mac check in GCM failed
      and fails if it is not thrown.

      The expected exception is supposed to be thrown at:
      org.apache.xml.security.stax.impl.processor.input.AbstractDecryptInputProcessor$DecryptionThread$1.close()
      and it is thrown indeed, but obviously after the main thread checks for it.

      There is even a "todo" comment in the AbstractDecryptedEventReaderInputProcessor code:

      //test again for an exception in the decryption thread.
      //todo: Thread.join()...
      testAndThrowUncaughtException();

        Attachments

          Activity

            People

            • Assignee:
              giger Marc Giger
              Reporter:
              gino Giedrius Noreikis

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment