draft-ietf-ldapbis-dn-09.txt   draft-ietf-ldapbis-dn-10.txt 
INTERNET-DRAFT Editor: Kurt D. Zeilenga INTERNET-DRAFT Editor: Kurt D. Zeilenga
Intended Category: Standard Track OpenLDAP Foundation Intended Category: Standard Track OpenLDAP Foundation
Expires in six months 3 March 2003 Expires in six months 4 May 2003
Obsoletes: 2253 Obsoletes: 2253
LDAP: String Representation of Distinguished Names LDAP: String Representation of Distinguished Names
<draft-ietf-ldapbis-dn-09.txt> <draft-ietf-ldapbis-dn-10.txt>
Status of Memo Status of Memo
This document is an Internet-Draft and is in full conformance with all This document is an Internet-Draft and is in full conformance with all
provisions of Section 10 of RFC2026. provisions of Section 10 of RFC2026.
This document is intended to be, after appropriate review and This document is intended to be, after appropriate review and
revision, submitted to the RFC Editor as a Standard Track document revision, submitted to the RFC Editor as a Standard Track document
replacing RFC 2253. Distribution of this memo is unlimited. replacing RFC 2253. Distribution of this memo is unlimited.
Technical discussion of this document will take place on the IETF LDAP Technical discussion of this document will take place on the IETF LDAP
skipping to change at page 3, line 14 skipping to change at page 3, line 14
This document obsoletes RFC 2253. Changes since RFC 2253 are This document obsoletes RFC 2253. Changes since RFC 2253 are
summarized in Appendix B. summarized in Appendix B.
This specification assumes familiarity with X.500 [X.500], and the This specification assumes familiarity with X.500 [X.500], and the
concept of Distinguished Name [X.501][Models]. concept of Distinguished Name [X.501][Models].
2. Converting DistinguishedName from ASN.1 to a String 2. Converting DistinguishedName from ASN.1 to a String
X.501 [X.501] defines the ASN.1 [X.680] structure of distinguished X.501 [X.501] defines the ASN.1 [X.680] structure of distinguished
name. The following is a varient provided for discussion purposes. name. The following is a variant provided for discussion purposes.
DistinguishedName ::= RDNSequence DistinguishedName ::= RDNSequence
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
RelativeDistinguishedName ::= SET SIZE (1..MAX) OF RelativeDistinguishedName ::= SET SIZE (1..MAX) OF
AttributeTypeAndValue AttributeTypeAndValue
AttributeTypeAndValue ::= SEQUENCE { AttributeTypeAndValue ::= SEQUENCE {
type AttributeType, type AttributeType,
skipping to change at page 4, line 19 skipping to change at page 4, line 19
AttributeTypeAndValues are separated by a plus sign ("+" U+002B) AttributeTypeAndValues are separated by a plus sign ("+" U+002B)
character. character.
2.3. Converting AttributeTypeAndValue 2.3. Converting AttributeTypeAndValue
The AttributeTypeAndValue is encoded as the string representation of The AttributeTypeAndValue is encoded as the string representation of
the AttributeType, followed by an equals ("=" U+003D) character, the AttributeType, followed by an equals ("=" U+003D) character,
followed by the string representation of the AttributeValue. The followed by the string representation of the AttributeValue. The
encoding of the AttributeValue is given in Section 2.4. encoding of the AttributeValue is given in Section 2.4.
If the AttributeType is in the following table of attribute types If the AttributeType is defined to have a short name and that short
associated with LDAP [Schema], then the type name string, a <descr>, name is known to be registered [REGISTRY] as identifying the
from that table is used, otherwise it is encoded as the dotted-decimal AttributeType, that short name, a <descr>, is used. Otherwise the
encoding, a <numericoid>, of the AttributeType's OBJECT IDENTIFIER. AttributeType is encoded as the dotted-decimal encoding, a
The <descr> and <numericoid> is defined in [Models]. <numericoid>, of its OBJECT IDENTIFIER. The <descr> and <numericoid>
is defined in [Models].
The type name string is not case sensitive.
String X.500 AttributeType
------ --------------------------------------------
CN commonName (2.5.4.3)
L localityName (2.5.4.7)
ST stateOrProvinceName (2.5.4.8)
O organizationName (2.5.4.10)
OU organizationalUnitName (2.5.4.11)
C countryName (2.5.4.6)
STREET streetAddress (2.5.4.9)
DC domainComponent (0.9.2342.19200300.100.1.25)
UID userId (0.9.2342.19200300.100.1.1)
Note: This table lists the complete set of type name strings which all Implementations are not expected dynamically update their knowledge of
implementations MUST recognize in DN string representation (per registered short names. However, implementations SHOULD provide a
Section 3). As no extension could reasonably require all mechanism to allow its knowledge of registered short names to be
existing implementations be updated to recognize additional type updated.
name strings, this table is not extensible.
2.4. Converting an AttributeValue from ASN.1 to a String 2.4. Converting an AttributeValue from ASN.1 to a String
If the AttributeType is of the dotted-decimal form, the AttributeValue If the AttributeType is of the dotted-decimal form, the AttributeValue
is represented by an number sign ("#" U+0023) character followed by is represented by an number sign ("#" U+0023) character followed by
the hexadecimal encoding of each of the octets of the BER encoding of the hexadecimal encoding of each of the octets of the BER encoding of
the X.500 AttributeValue. This form is also used when the syntax of the X.500 AttributeValue. This form is also used when the syntax of
the AttributeValue does not have a native string encoding defined for the AttributeValue does not have a native string encoding defined for
it or the native string encoding is not restricted to UTF-8 encoded it or the native string encoding is not restricted to UTF-8 encoded
UCS (or a subset of UCS) characters. This form may also be used in UCS (or a subset of UCS) characters. This form may also be used in
skipping to change at page 5, line 42 skipping to change at page 5, line 28
Each octet of the character to be escaped is replaced by a backslash Each octet of the character to be escaped is replaced by a backslash
and two hex digits, which form a single octet in the code of the and two hex digits, which form a single octet in the code of the
character. Alternatively, if and only if the character to be escaped character. Alternatively, if and only if the character to be escaped
is one of is one of
" ", """, "#", "+", ",", ";", "<", "=", ">", or "\" " ", """, "#", "+", ",", ";", "<", "=", ">", or "\"
(U+0020, U+0022, U+0023, U+002B, U+002C, U+003B, (U+0020, U+0022, U+0023, U+002B, U+002C, U+003B,
U+003C, U+003D, U+003E, U+005C respectively) U+003C, U+003D, U+003E, U+005C respectively)
it can be prefixed by a backslash ("\" U+005C). it can be prefixed by a backslash ("\" U+0005C).
Examples of the escaping mechanism are shown in Section 4. Examples of the escaping mechanism are shown in Section 4.
3. Parsing a String back to a Distinguished Name 3. Parsing a String back to a Distinguished Name
The string representation of Distinguished Names is restricted to The string representation of Distinguished Names is restricted to
UTF-8 [RFC2279] encoded characters from the Universal Character Set UTF-8 [RFC2279] encoded characters from the Universal Character Set
(UCS) [ISO10646]. The structure of this string representation is (UCS) [ISO10646]. The structure of this string representation is
specified using the following Augmented BNF [RFC2234] grammar: specified using the following Augmented BNF [RFC2234] grammar:
skipping to change at page 7, line 7 skipping to change at page 6, line 40
where the productions <descr>, <numericoid>, <COMMA>, <DQUOTE>, where the productions <descr>, <numericoid>, <COMMA>, <DQUOTE>,
<EQUALS>, <ESC>, <HEX>, <LANGLE>, <NULL>, <PLUS>, <RANGLE>, <SEMI>, <EQUALS>, <ESC>, <HEX>, <LANGLE>, <NULL>, <PLUS>, <RANGLE>, <SEMI>,
<SPACE>, <SHARP>, <UTFMB> are defined in [Models]. <SPACE>, <SHARP>, <UTFMB> are defined in [Models].
Each <attributeType>, either a <descr> or a <numericoid>, refers to an Each <attributeType>, either a <descr> or a <numericoid>, refers to an
attribute type of an attribute value assertion (AVA). The attribute type of an attribute value assertion (AVA). The
<attributeType> is followed by a <EQUALS> and an <attributeValue>. <attributeType> is followed by a <EQUALS> and an <attributeValue>.
The <attributeValue> is either in <string> or <hexstring> form. The <attributeValue> is either in <string> or <hexstring> form.
If in <string> form, a LDAP string represention asserted value can be If in <string> form, a LDAP string representation asserted value can
obtained by replacing (left-to-right, non-recursively) each <pair> be obtained by replacing (left-to-right, non-recursively) each <pair>
appearing in the <string> as follows: appearing in the <string> as follows:
replace <ESC><ESC> with <ESC>; replace <ESC><ESC> with <ESC>;
replace <ESC><special> with <special>; replace <ESC><special> with <special>;
replace <ESC><hexpair> with the octet indicated by the <hexpair>. replace <ESC><hexpair> with the octet indicated by the <hexpair>.
If in <hexstring> form, a BER representation can be obtained from If in <hexstring> form, a BER representation can be obtained from
converting each <hexpair> of the <hexstring> to the octet indicated by converting each <hexpair> of the <hexstring> to the octet indicated by
the <hexpair>. the <hexpair>.
One or more attribute values assertions, separated by <PLUS>, for a One or more attribute values assertions, separated by <PLUS>, for a
relative distinguished name. relative distinguished name.
Zero or more relative distinguished names, separated by <COMMA>, for a Zero or more relative distinguished names, separated by <COMMA>, for a
distinguished name. distinguished name.
Implementations MUST recognize AttributeType name strings Implementations MUST recognize AttributeType name strings
(descriptors) listed in the Section 2.3 table, but MAY recognize other (descriptors) listed in the following table, but MAY recognize other
name strings. Implementations MAY recognize other DN string name strings.
representations (such as that described in RFC 1779). However, as
there is no requirement for other names or alternative DN string String X.500 AttributeType
representations to be recognized (and, if so, how), implementations ------ --------------------------------------------
SHOULD only generate DN strings in accordance with Section 2 of this CN commonName (2.5.4.3)
document. L localityName (2.5.4.7)
ST stateOrProvinceName (2.5.4.8)
O organizationName (2.5.4.10)
OU organizationalUnitName (2.5.4.11)
C countryName (2.5.4.6)
STREET streetAddress (2.5.4.9)
DC domainComponent (0.9.2342.19200300.100.1.25)
UID userId (0.9.2342.19200300.100.1.1)
Implementations MAY recognize other DN string representations
(such as that described in RFC 1779). However, as there is no
requirement that alternative DN string representations to be
recognized (and, if so, how), implementations SHOULD only generate
DN strings in accordance with Section 2 of this document.
4. Examples 4. Examples
This notation is designed to be convenient for common forms of name. This notation is designed to be convenient for common forms of
This section gives a few examples of distinguished names written using name. This section gives a few examples of distinguished names
this notation. First is a name containing three relative written using this notation. First is a name containing three
distinguished names (RDNs): relative distinguished names (RDNs):
UID=jsmith,DC=example,DC=net UID=jsmith,DC=example,DC=net
Here is an example name containing three RDNs, in which the first RDN Here is an example name containing three RDNs, in which the first
is multi-valued: RDN is multi-valued:
OU=Sales+CN=J. Smith,DC=example,DC=net OU=Sales+CN=J. Smith,DC=example,DC=net
This example shows the method of escaping of a comma in a common name: This example shows the method of escaping of a comma in a common
name:
CN=John Smith\, III,DC=example,DC=net CN=John Smith\, III,DC=example,DC=net
An example name in which a value contains a carriage return character:
An example name in which a value contains a carriage return
character:
CN=Before\0dAfter,DC=example,DC=net CN=Before\0dAfter,DC=example,DC=net
An example name in which an RDN was of an unrecognized type. The An example name in which an RDN was of an unrecognized type. The
value is the BER encoding of an OCTET STRING containing two octets value is the BER encoding of an OCTET STRING containing two octets
0x48 and 0x69. 0x48 and 0x69.
1.3.6.1.4.1.1466.0=#04024869,DC=example,DC=com 1.3.6.1.4.1.1466.0=#04024869,DC=example,DC=com
Finally, an example of an RDN commonName value consisting of 5 Finally, an example of an RDN commonName value consisting of 5
skipping to change at page 9, line 9 skipping to change at page 9, line 9
- its physical location (country, locality, city, street address) - its physical location (country, locality, city, street address)
- organizational attributes (such as department name or affiliation) - organizational attributes (such as department name or affiliation)
Most countries have privacy laws regarding the publication of Most countries have privacy laws regarding the publication of
information about people. information about people.
5.2. Use of Distinguished Names in Security Applications 5.2. Use of Distinguished Names in Security Applications
The transformations of an AttributeValue value from its X.501 form to The transformations of an AttributeValue value from its X.501 form to
an LDAP string representation are not always reversible back to the an LDAP string representation are not always reversible back to the
same BER (Base Encoding Rules) or DER (Distinguished Encoding Rules) same BER (Basic Encoding Rules) or DER (Distinguished Encoding rules)
form. An example of a situation which requires the DER form of a form. An example of a situation which requires the DER form of a
distinguished name is the verification of an X.509 certificate. distinguished name is the verification of an X.509 certificate.
For example, a distinguished name consisting of one RDN with one AVA, For example, a distinguished name consisting of one RDN with one AVA,
in which the type is commonName and the value is of the TeletexString in which the type is commonName and the value is of the TeletexString
choice with the letters 'Sam' would be represented in LDAP as the choice with the letters 'Sam' would be represented in LDAP as the
string CN=Sam. Another distinguished name in which the value is still string CN=Sam. Another distinguished name in which the value is still
'Sam' but of the PrintableString choice would have the same 'Sam' but of the PrintableString choice would have the same
representation CN=Sam. representation CN=Sam.
Applications which require the reconstruction of the DER form of the Applications which require the reconstruction of the DER form of the
value SHOULD NOT use the string representation of attribute syntaxes value SHOULD NOT use the string representation of attribute syntaxes
when converting a distinguished name to the LDAP format. Instead, when converting a distinguished name to the LDAP format. Instead,
they SHOULD use the hexadecimal form prefixed by the number sign ('#') they SHOULD use the hexadecimal form prefixed by the number sign ('#')
as described in the first paragraph of Section 2.3. as described in the first paragraph of Section 2.3.
5.3. Use of Other Names
Attribute type names are not unique. A string representation
generated with names other than those in the Section 2.3 table is
ambiguous. That is, two applications may recognize the string as
representing two different DNs possibly associated with two different
entries. This may lead to a wide range of unexpected behaviors which
can have both direct and indirect impacts upon security.
For example, a distinguished name consisting of one RDN with one AVA
of the known locally attribute type FOO and the value "BAR" (an
octetString) could be represented in LDAP as the string FOO=BAR. As
the name FOO does not uniquely identify an attribute type, the DN
string representation FOO=BAR is ambiguous. That is, FOO could be
recognized as the attribute type 1.1.1 by one application and 1.2.3.4
in another and not recognized by another. This may lead to operations
not behaving as intended.
Applications desiring to generate an unambiguous string representation
of a DN SHOULD generate string representation per section 2, not use
names other than those in the Section 2.3 table, and while taking
Section 5.2 into consideration.
It is noted that while a registry for attribute type names
(descriptors) has been established [RFC3383], however this registry
does not remove the ambiguity of attribute types names used in LDAP.
It only removes the ambiguity of attribute type names used in Standard
Track technical specifications.
6. Acknowledgment 6. Acknowledgment
This document is an update to RFC 2253, by Mark Wahl, Tim Howes, and This document is an update to RFC 2253, by Mark Wahl, Tim Howes, and
Steve Kille. RFC 2253 was a product of the IETF ASID Working Group. Steve Kille. RFC 2253 was a product of the IETF ASID Working Group.
This document is a product of the IETF LDAPBIS Working Group. This document is a product of the IETF LDAPBIS Working Group.
7. Document Editor's Address 7. Document Editor's Address
Kurt D. Zeilenga Kurt D. Zeilenga
skipping to change at page 12, line 47 skipping to change at page 12, line 18
Another alternative is to use the LDAP Data Interchange Format (LDIF) Another alternative is to use the LDAP Data Interchange Format (LDIF)
[RFC2849]. For example, [RFC2849]. For example,
# This entry has a long DN... # This entry has a long DN...
dn: CN=Kurt D. Zeilenga,OU=Engineering,L=Redwood Shores, dn: CN=Kurt D. Zeilenga,OU=Engineering,L=Redwood Shores,
O=OpenLDAP Foundation,ST=California,C=US O=OpenLDAP Foundation,ST=California,C=US
CN: Kurt D. Zeilenga CN: Kurt D. Zeilenga
SN: Zeilenga SN: Zeilenga
objectClass: person objectClass: person
It is noted that it may be desirable to replace dotted-decimal OIDs
appearing in DN strings with attribute type names. Such replacement
is viewed as a translation and, hence, not discussed here.
Appendix B. Changes made since RFC 2253 Appendix B. Changes made since RFC 2253
This appendix is provided for informational purposes only, it is not a This appendix is provided for informational purposes only, it is not a
normative part of this specification. normative part of this specification.
The following substantive changes were made to RFC 2253: The following substantive changes were made to RFC 2253:
- Removed IESG Note. The IESG Note has been addressed. - Removed IESG Note. The IESG Note has been addressed.
- Clarified (in Section 1), that this document does not define a - Clarified (in Section 1), that this document does not define a
canonical string representation. canonical string representation.
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/