#3019 org.mozilla.jss.netscape.security.util.ObjectIdentifier cannot parse OIDs larger than Integer.MAX_VALUE
Closed: fixed Opened by awood.

We have an OID with a very long component, 1526059423098, which is greater than Integer.MAX_VALUE (2147483647). Unfortunately, org.mozilla.jss.netscape.security.util.ObjectIdentifier parses the OID components with Integer.valueOf(comp).intValue(); which obviously fails with a NumberFormatException.

For my purposes, a Long would be sufficient, but near as I can tell, the specifications don't have any real limit on the maximum value of an arc (except for the limits imposed by DER encoding). BouncyCastle works correctly [1], using Longs and BigIntegers as necessary.

[1]
https://github.com/bcgit/bc-java/blob/master/core/src/main/java/org/bouncycastle/asn1/ASN1ObjectIdentifier.java


Thanks for the bug report. It is indeed a bug. From ITU X.660 section 7.6:

Primary integer values for arcs (and the corresponding integer-valued Unicode label) are unbounded, except
a) the root arcs are restricted to three arcs with primary integer values 0 to 2 ; and
b) the arcs beneath the root arcs 0 and 1 are restricted to forty arcs with primary integer values 0 to 39 .

Metadata Update from @ftweedal:
- Custom field component adjusted to None
- Custom field feature adjusted to None
- Custom field origin adjusted to None
- Custom field proposedmilestone adjusted to None
- Custom field proposedpriority adjusted to None
- Custom field reviewer adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None

Metadata Update from @mharmsen:
- Issue set to the milestone: 0.0 NEEDS_TRIAGE

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.5 (was: 0.0 NEEDS_TRIAGE)

Metadata Update from @mharmsen:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1577991

Metadata Update from @mharmsen:
- Issue assigned to jmagne

commit 06eacad918e745d632067deea398f14ce9da29ac (HEAD -> JSS_4_4_BRANCH, origin/JSS_4_4_BRANCH)
Author: Jack Magne jmagne@redhat.com
Date: Fri Jun 15 14:53:53 2018 -0700

Metadata Update from @mharmsen:
- Issue set to the milestone: 10.5.9 (was: 10.5)

Metadata Update from @mharmsen:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Dogtag PKI is moving from Pagure issues to GitHub issues. This means that existing or new
issues will be reported and tracked through Dogtag PKI's GitHub Issue tracker.

This issue has been cloned to GitHub and is available here:
https://github.com/dogtagpki/pki/issues/3137

If you want to receive further updates on the issue, please navigate to the
GitHub issue and click on Subscribe button.

Thank you for understanding, and we apologize for any inconvenience.

Metadata