RFR: 8258915: Temporary buffer cleanup [v4]

Valerie Peng valeriep at openjdk.java.net
Sat Jan 23 05:23:44 UTC 2021


On Fri, 22 Jan 2021 21:28:53 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> Clean up temporary byte array, char array, and keyspec around keys and passwords.
>> 
>> No new regression test.
>
> Weijun Wang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   keyfactory operations on own keyspec

src/jdk.crypto.ec/share/classes/sun/security/ec/ECPrivateKeyImpl.java line 133:

> 131:             out.putInteger(1); // version 1
> 132:             out.putOctetString(sOctets);
> 133:             Arrays.fill(sOctets, (byte)0);

The same handling should apply to line 106 above inside makeEncoding(byte[])?

src/jdk.crypto.ec/share/classes/sun/security/ec/ECPrivateKeyImpl.java line 136:

> 134:             DerValue val = DerValue.wrap(DerValue.tag_Sequence, out);
> 135:             key = val.toByteArray();
> 136:             val.clear();

Same handling should apply to line 107-109 above inside makeEncoding(byte[])?

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

PR: https://git.openjdk.java.net/jdk/pull/2070



More information about the security-dev mailing list