On Fri, 3 Oct 2025 14:42:27 GMT, Weijun Wang <[email protected]> wrote:

>> Anthony Scarpino has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   missed some decoder comments
>
> src/java.base/share/classes/sun/security/ec/ECPrivateKeyImpl.java line 252:
> 
>> 250:                 int version = seq.data.getInteger();
>> 251:                 if (version == 1) { // EC
>> 252:                     byte[] oct = seq.data.getOctetString();  // private 
>> key
> 
> If you call `seq.data.getDerValue()` then the return value uses the original 
> array with an offset and a length. So there is no need to call `Arrays.fill` 
> next.

cool, thanks.. I didn't realize it didn't make a`getDerValue` didn't make a 
copy.

> src/java.base/share/classes/sun/security/util/Pem.java line 376:
> 
>> 374:             SharedSecrets.getJavaSecuritySpecAccess().
>> 375:                 clearEncodedKeySpec(p8KeySpec);
>> 376:             keySpec.clearPassword();
> 
> Why are the lines above indented? Were you trying to add a try-finally here?

Yes, I fixed that.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27147#discussion_r2423026619
PR Review Comment: https://git.openjdk.org/jdk/pull/27147#discussion_r2423065762

Reply via email to