Subject: [ldapext] Schema OID definition limits

From: "Mark Hinckley" <[email-masked]>
Date: Thu, 07 Apr 2011 16:11:04 -0600

Is there a limit defined in the LDAP RFCs anywhere for the length of the OID value for a schema definition, for example inetOrgPerson is 2.16.840.1.113730.3.2.2, whereas organization is 2.5.6.4.  Is there a maximum length defined for how long that digit string can be for custom schema?  For example, should 1.2.840.112233.1.1234.5678.12345.1234.123456.1234 be considered legal?
 
Thanks,
Mark Hinckley

---

From: Hallvard B Furuseth <[email-masked]>
Date: Fri, 8 Apr 2011 00:51:32 +0200

Mark Hinckley writes:
> Is there a limit defined in the LDAP RFCs anywhere for the length of
> the OID value for a schema definition, for example inetOrgPerson is
> 2.16.840.1.113730.3.2.2, whereas organization is 2.5.6.4.

I don't think so.  Object identifiers are defined by ASN.1, the LDAP
RFCs just refer to it.

> Is there a
> maximum length defined for how long that digit string can be for
> custom schema?  For example, should
> 1.2.840.112233.1.1234.5678.12345.1234.123456.1234 be considered legal?

That's a valid OID.  There are some limits:

1st component must be <= 2.  If 1st comp. <= 1, then 2nd component must
be < 40.  That's due to the ASN.1/BER representation of OIDs, which
represents the first two components as one number 40*<1st component> +
<2nd component>.

Finally, your OIDs might meet a quick-and-dirty implementation which
represents OID components as fixed-size machine integers.  So it may be
advisable to stick to components < 2**31, and 2nd component < 2**31/40.
Or nowadays, perhaps I should be saying 63 instead of 31 bits.  (The
final bit would be for the sign, or for a "this is the last OID
component" flag.)

-- 
Hallvard

---

From: Hallvard B Furuseth <[email-masked]>
Date: Fri, 8 Apr 2011 00:59:09 +0200

> I don't think so.  Object identifiers are defined by ASN.1, the LDAP

Whoops - poorly placed sentence.  To clarify: Nor do I know of
limitations in ASN.1:-)

> final bit would be for the sign, or for a "this is the last OID

For the positive sign, I should have said.  For languages or code which
use signed integers.

-- 
Hallvard