RFR: 8308808: SunMSCAPI public keys returns internal key array [v2]

Ben Perez duke at openjdk.org
Wed Jun 14 20:52:57 UTC 2023


On Wed, 14 Jun 2023 20:28:15 GMT, Sean Mullan <mullan at openjdk.org> wrote:

>> Ben Perez has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Changed array copy to be more compact
>
> src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CPublicKey.java line 99:
> 
>> 97:             byte[] safeEncoding = new byte[encoding.length];
>> 98:             System.arraycopy(encoding, 0, safeEncoding, 0, encoding.length);
>> 99:             return safeEncoding;
> 
> You can replace these lines (and below) with `return encoding.clone();` which is more compact and the same AFAICT.

Good call, just pushed those changes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14425#discussion_r1230155017



More information about the security-dev mailing list