Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
Java 2.1.4
-
None
-
None
-
None
Description
Sometimes we receive XML signatures that have <Signature> Base64 value provided with many line feed characters and decoding of this value fails. Below is the code to reproduce:
String base64 = "PHhtbD5hbGEgbWEga290YTwveG1sPg=\n\n="; XMLUtils.decode(base64.getBytes());
and the exception it throws:
Exception in thread "main" java.lang.IllegalArgumentException: Input byte array has wrong 4-byte ending unit at java.util.Base64$Decoder.decode0(Base64.java:704) at java.util.Base64$Decoder.decode(Base64.java:526) at org.apache.xml.security.utils.XMLUtils.decode(XMLUtils.java:553)
This problem does not occur on 2.0.10 version.