You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (Jira)" <ji...@apache.org> on 2020/02/21 06:55:00 UTC
[jira] [Closed] (SANTUARIO-517) XMLUtils.decode fails for certain
Base64 strings
[ https://issues.apache.org/jira/browse/SANTUARIO-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Colm O hEigeartaigh closed SANTUARIO-517.
-----------------------------------------
> XMLUtils.decode fails for certain Base64 strings
> ------------------------------------------------
>
> Key: SANTUARIO-517
> URL: https://issues.apache.org/jira/browse/SANTUARIO-517
> Project: Santuario
> Issue Type: Bug
> Affects Versions: Java 2.1.4
> Reporter: Rafał Gała
> Assignee: Colm O hEigeartaigh
> Priority: Major
> Attachments: SANTUARIO-517.patch
>
>
> 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:
> {code:java}
> String base64 = "PHhtbD5hbGEgbWEga290YTwveG1sPg=\n\n=";
> XMLUtils.decode(base64.getBytes());
> {code}
> and the exception it throws:
> {code:java}
> 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)
> {code}
> This problem does not occur on 2.0.10 version.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)