RFR: 8258915: Temporary buffer cleanup [v4]

Valerie Peng valeriep at openjdk.java.net
Mon Jan 25 11:37:45 UTC 2021


On Sat, 23 Jan 2021 16:11:02 GMT, Weijun Wang <weijun at openjdk.org> wrote:

>> src/java.base/share/classes/com/sun/crypto/provider/DHPrivateKey.java line 116:
>> 
>>> 114:             encode();
>>> 115:         } catch (IOException e) {
>>> 116:             throw new ProviderException("Cannot produce ASN.1 encoding", e);
>> 
>> Supposedly the IOException should never happen? Otherwise the Arrays.fill(...) call may not happen. Some throws AssertionError wrapping the IOException, just checking to see this is also the case.
>
> No, it should never happen. `DerValue::toByteArray` claims it might throw an IOE because `DerOutputStream::putLength` claims so, but you can see the latter never throws one. I thought about removing those `throws IOE` but there are too many. We can do it in another code change.

Ok.

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

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



More information about the security-dev mailing list