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

Sean Mullan mullan at openjdk.org
Mon Jul 7 21:26:38 UTC 2025


On Mon, 7 Jul 2025 21:08:55 GMT, Valerie Peng <valeriep at openjdk.org> wrote:

>> Based on the javadoc of `javax.crypto.Cipher` class, the cipher transformation should be either "algorithm/mode/padding" or
>> "algorithm". When parsing the transformation, space(s) is trimmed off and empty strings are considered as "unspecified". This PR adds checks to ensure that transformations with empty "mode" and/or "padding" value in the "algorithm/mode/padding" form leads to `NoSuchAlgorithmException`. This reverts some changes made in [https://bugs.openjdk.org/browse/JDK-8358159](https://bugs.openjdk.org/browse/JDK-8358159) which allows empty mode and/or padding in the transformations.
>> 
>> 
>> Thanks in advance for the review~
>
> Valerie Peng has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove bug id 8358159 from the test.

Marked as reviewed by mullan (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/25808#pullrequestreview-2995307901


More information about the security-dev mailing list