RFR: 8359388: Stricter checking for cipher transformations [v2]

Mikhail Yankelevich myankelevich at openjdk.org
Tue Jun 17 10:34:30 UTC 2025


On Mon, 16 Jun 2025 21:32:16 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> src/java.base/share/classes/javax/crypto/Cipher.java line 348:
>> 
>>> 346:                 transformation.substring(0, endIdx).trim());
>>> 347:         if (algo.isEmpty()) {
>>> 348:             throw new NoSuchAlgorithmException("Invalid transformation: " +
>> 
>> I don't think this exception is tested. It could be by adding `test(" ", provider);` in [test/jdk/javax/crypto/Cipher/TestEmptyModePadding.java](https://github.com/openjdk/jdk/pull/25808/files#diff-5442ba4fbe85af64a99ca3c2d2b5795026be4c40e23af8337d52a64cefd6af35) on line 68
>
> Sure, I can add it.

Thank you! This is covered now

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25808#discussion_r2151921175


More information about the security-dev mailing list