RFR: 8249783: Simplify DerValue and DerInputStream [v2]
Valerie Peng
valeriep at openjdk.java.net
Tue Sep 29 01:03:32 UTC 2020
On Fri, 25 Sep 2020 23:00:22 GMT, Weijun Wang <weijun at openjdk.org> wrote:
>> src/java.base/share/classes/sun/security/util/DerInputStream.java line 139:
>>
>>> 137: // does not accept constructed OCTET STRING.
>>> 138: DerValue v = getDerValue();
>>> 139: if (v.tag != DerValue.tag_OctetString) {
>>
>> Only this method checks tag of the DerValue?
>
> Yes, this is because `DerValue::getOctetString` allows constructed value but `DerInputStream::getOctetString` only
> accepts primitive value. This is for compatibility.
> All other methods will have tag checked inside the corresponding DerValue method. Do you prefer a fast fail?
I just wonder why the different handling. Do you know why? Is it really used/needed, just curious?
-------------
PR: https://git.openjdk.java.net/jdk/pull/232
More information about the security-dev
mailing list