On Mon, 21 Sep 2020 00:19:53 GMT, Weijun Wang <[email protected]> wrote:
>> Roger Riggs has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Small cleanups to javadoc and code
>
> test/lib/jdk/test/lib/hexdump/ASN1Formatter.java line 228:
>
>> 226: break;
>> 227:
>> 228: case TAG_OctetString:
>
> I'd rather print nothing for OCTET STRING. My understanding of it is opaque
> octets and not meant to be printable.
Octet Strings can may contain printable strings and it is useful to print them.
A heuristic is used to determine if they are printable and the length is
limited to avoid spewing garbage.
> test/lib/jdk/test/lib/hexdump/ASN1Formatter.java line 362:
>
>> 360: switch (tag & 0xc0) {
>> 361: case TAG_APPLICATION:
>> 362: return "APPLICATION " + cons + (tag & 0x1f);
>
> I am not sure how important it is to print out "cons". Also, the tag here is
> usually shown as "[1]" in ASN.1
> definition. Of course, if you choose this style, you might want to avoid
> using brackets for length.
It provides a more complete info on the tag even though the application may not
have publicly defined its values.
-------------
PR: https://git.openjdk.java.net/jdk/pull/268