RFR: 8313226: Redundant condition test in X509CRLImpl

Jamil Nimeh jnimeh at openjdk.org
Tue Aug 1 15:25:53 UTC 2023


On Thu, 27 Jul 2023 04:00:21 GMT, John Jiang <jjiang at openjdk.org> wrote:

> if ((nextByte == DerValue.tag_SequenceOf)
>         && (! ((nextByte & 0x0c0) == 0x080))) {
>     ...
>     ...
> }
> 
> If `nextByte` is `DerValue.tag_SequenceOf`, exactly `0x30`, then the test after `&&` should always be true.

The change itself looks fine to me since bits 8 and 7 will always be zero when `nextByte` is 0x30.  It looks like the second check was to see if the tag was a context-specific tag, but I don't know why since RFC 5280 doesn't indicate that it can be context specific.  I wonder if it is a remnant from an earlier version of the code.
Regardless, the second clause isn't doing anything so the removal looks good to me.

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

Marked as reviewed by jnimeh (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15051#pullrequestreview-1557271462



More information about the security-dev mailing list