RFR: 8302017: Allocate BadPaddingException only if it will be thrown [v2]
Valerie Peng
valeriep at openjdk.org
Mon Jul 17 23:04:05 UTC 2023
On Thu, 13 Jul 2023 04:25:19 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:
>> Valerie Peng has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Address review feedbacks, e.g. Removed RSAPadding.Output and use byte[] as before.
>
> src/java.base/share/classes/sun/security/rsa/RSASignature.java line 196:
>
>> 194: return RSACore.rsa(padded, privateKey, true);
>> 195: }
>> 196: throw new SignatureException("Could not sign data");
>
> It may be clearer if the throw line is moved to the end of the method. Otherwise, I have to check if SignatureException is a sub-class of GeneralSecurityException.
Yes, I think so too.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14839#discussion_r1265980475
More information about the security-dev
mailing list