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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Java 2.0.0
    • Java 2.0.1
    • Java
    • 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

            giger Marc Giger
            gino Giedrius Noreikis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: