On Tue, 10 Mar 2026 15:50:37 GMT, Hai-May Chao <[email protected]> wrote:
> Exception changes in Hybrid for errors in engineDecapsulate() and
> engineEncapsulate().
src/java.base/share/classes/sun/security/ssl/Hybrid.java line 321:
> 319: int expectedSecretSize = engineSecretSize();
> 320: if (!(from == 0 && to == expectedSecretSize)) {
> 321: throw new IndexOutOfBoundsException(
It's OK if you add a `Objects.checkFromToIndex(from, to, expectedSecretSize)`
call before this line to throw any IOOBE if necessary, but this line is to
confirm we don't support slicing of the shared secrets. Therefore IAE is still
the correct exception.
Same below in decapsulation.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30167#discussion_r2918194157