Integrated: 8366833: Poly1305 does not always correctly update position for array-backed ByteBuffers after processMultipleBlocks
Jamil Nimeh
jnimeh at openjdk.org
Fri Sep 12 20:42:37 UTC 2025
On Thu, 4 Sep 2025 02:23:50 GMT, Jamil Nimeh <jnimeh at openjdk.org> wrote:
> This fix resolves an issue where the `Cipher.updateAAD(ByteBuffer)` method, when used on a ChaCha20-Poly1305 Cipher, may throw an exception due to an offset calculation error. This occurs when the ByteBuffer is array-backed, and when the buffer passed into the method is a slice of another array-backed buffer and that slice begins at a non-zero offset in the parent ByteBuffer.
>
> Credit and thanks to @jaikiran for finding the issue and providing reproducer code.
This pull request has now been integrated.
Changeset: 3eb3e0dc
Author: Jamil Nimeh <jnimeh at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/3eb3e0dcb0aa06fe427adeeaa40b9568c7f07ee8
Stats: 191 lines in 2 files changed: 189 ins; 0 del; 2 mod
8366833: Poly1305 does not always correctly update position for array-backed ByteBuffers after processMultipleBlocks
Co-authored-by: Jaikiran Pai <jpai at openjdk.org>
Reviewed-by: weijun, jpai
-------------
PR: https://git.openjdk.org/jdk/pull/27081
More information about the security-dev
mailing list