oscerd opened a new pull request, #24723:
URL: https://github.com/apache/camel/pull/24723

   Backport of #24716 to `camel-4.18.x` (fixVersion **4.18.4**) — **charset 
only**.
   
   `sign`/`verify` encoded a `String` body with `String.getBytes()` (the JVM 
default charset). The default charset is platform dependent, so signing on one 
JVM and verifying on another with a different default disagrees on the bytes of 
a non-ASCII payload and verification fails. Pin `StandardCharsets.UTF_8`.
   
   **Scope vs main:** the native `byte[]`/`InputStream` handling delivered on 
main by CAMEL-23847 is an *improvement* kept to `main`, so it is intentionally 
**not** in this backport — only the charset determinism fix for `String` 
payloads. This branch has no hybrid sign/verify, so only 
`signature()`/`verification()` are touched.
   
   **Note on the test:** the bug is JVM-default-charset dependent (a no-op on 
Java 18+ where the default is already UTF-8, per JEP 400), so the test pins the 
UTF-8 *contract* — it independently verifies the produced signature over the 
payload's UTF-8 bytes and confirms it does not match the ISO-8859-1 bytes. 
Validated green on this branch; no generated drift.
   
   _Claude Code on behalf of Andrea Cosentino._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to