You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2018/10/30 10:06:04 UTC
[jira] [Closed] (CXF-7858) Base64 empty string encoding issue
[ https://issues.apache.org/jira/browse/CXF-7858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Colm O hEigeartaigh closed CXF-7858.
------------------------------------
> Base64 empty string encoding issue
> ----------------------------------
>
> Key: CXF-7858
> URL: https://issues.apache.org/jira/browse/CXF-7858
> Project: CXF
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.2.6
> Reporter: Andriy Mahats
> Assignee: Colm O hEigeartaigh
> Priority: Blocker
> Fix For: 3.2.7, 3.1.18
>
>
> {code:java}
> char[] chunk = Base64Utility.encodeChunk("".getBytes(), 0, 0, true); // chunk = null after evaluation
> {code}
> According to [https://tools.ietf.org/html/rfc4648#section-10]
> h2. [10|https://tools.ietf.org/html/rfc4648#section-10]. Test Vectors
>
> BASE64("") = ""
>
> {code:java}
> // later it evaluates to null
> //org.apache.cxf.common.util.Base64UrlUtility#encodeChunk
> public static String encodeChunk(byte[] id, int offset, int length) {
> char[] chunk = Base64Utility.encodeChunk(id, offset, length, true);
> return chunk != null ? new String(chunk) : null;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)