[ 
https://issues.apache.org/jira/browse/CAMEL-26258?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-26258.
---------------------------------
    Resolution: Fixed

Fixed by https://github.com/apache/camel/pull/28949, merged to main as 
9ff19010c52c8096916a6dc2332bc3a0354c1915.

_Claude Code on behalf of davsclaus_

> camel-alibaba-kms - encrypt corrupts a binary InputStream or File plaintext 
> by converting it to a String before Base64
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-26258
>                 URL: https://issues.apache.org/jira/browse/CAMEL-26258
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Claus Ibsen
>            Assignee: Andrea Cosentino
>            Priority: Major
>             Fix For: 4.24.0
>
>
> Found while adding the catalog body types of alibaba-kms (CAMEL-24961, PR 
> #28409).
> h4. 1. A binary stream or File plaintext is corrupted
> {{KMSUtils.encodePlaintextForEncrypt}} (main 2a465aa4814c, lines 93-97) 
> Base64-encodes byte[] and String bodies as they are, but converts any other 
> body to a String first, so a binary {{InputStream}} or {{File}} is changed 
> before it is encrypted and decrypt gives back different bytes. Checked on 
> 4.24.0-SNAPSHOT with a Mockito client set on the endpoint.
> Proposed: convert the other bodies with {{getBody(byte[].class)}} before 
> Base64.
> _Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to