Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Java 2.0.0
-
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();