RFR: 8358159: Empty mode/padding in cipher transformations [v4]
Varada M
varadam at openjdk.org
Sat Jun 7 20:09:57 UTC 2025
On Thu, 5 Jun 2025 21:20:58 GMT, Valerie Peng <valeriep at openjdk.org> wrote:
>> Varada M has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8358159: Empty mode/padding in cipher transformations
>
> src/java.base/share/classes/javax/crypto/Cipher.java line 460:
>
>> 458: String pad = (parts[2].length() == 0 ? null : parts[2]);
>> 459:
>> 460: if ((mode == null || mode.isEmpty()) && (pad == null || pad.isEmpty())) {
>
> The `mode.isEmpty()` and `pad.isEmpty()` should always be `false` since line 457 and 458 already converted empty String to `null`, right? Looks redundant to me and can be removed.
You are right. I have updated accordingly. Thanks for pointing it out!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25547#discussion_r2134116721
More information about the security-dev
mailing list