On Sat, 23 Jan 2021 16:11:02 GMT, Weijun Wang <[email protected]> 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