RFR: 8360463: Ambiguity in Cipher.getInstance() specification between NoSuchAlgorithmException and NoSuchPaddingException [v7]

Valerie Peng valeriep at openjdk.org
Thu Sep 18 00:06:02 UTC 2025


On Thu, 4 Sep 2025 13:59:28 GMT, Sean Mullan <mullan at openjdk.org> wrote:

>> Valerie Peng has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address review comments from Sean.
>
> test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/ChaCha20CipherUnitTest.java line 85:
> 
>> 83: 
>> 84:         checkTransformation("ChaCha20/ECB/NoPadding", Expected.NSAE_OR_NSPE);
>> 85:         checkTransformation("ChaCha20/None/PKCS5Padding", Expected.NSAE_OR_NSPE);
> 
> Isn't this always going to throw NSPE given the current provider configuration? Also, same comment on line 88.

I can explicit specify `SunJCE` provider in the `getInstance(...)` call and then match the specific exception based on its impl.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26489#discussion_r2357054011


More information about the security-dev mailing list