RFR: 8377318: Force bad padding exception in TestPKCS5PaddingError.java at all times
Valerie Peng
valeriep at openjdk.org
Wed Feb 11 09:29:04 UTC 2026
On Tue, 10 Feb 2026 09:41:27 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:
>> test/jdk/sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java line 128:
>>
>>> 126: final String errorDescription =
>>> 127: "Decrypted text " + Arrays.toString(result) +
>>> 128: " " + new String(result);
>>
>> The "new String(result)" part doesn't add much value and can be omitted.
>> Not sure how useful to dump out the result when the key is generated on the fly. Without the key and parameters, not sure how useful this is.
>
> It was helpful to me when I was experimenting to see the behaviour at a glance from logs. We have some other information about which transformation and algorithm was used. My thoughts were to have something is better than nothing if this ever gets triggered.
>
> I'm happy to remove it if you believe it best though.
You already print out the byte[] (even though I wonder how useful this can be when you don't have the dynamically generated key value, maybe something to print out also?), doing the "new String(result)" part does not seem useful as it's just a bunch of Unicode characters. Not sure what kind of purpose it's for.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29612#discussion_r2791741558
More information about the security-dev
mailing list