draft-ietf-ldapbis-dn-06.txt   draft-ietf-ldapbis-dn-07.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: 20 January 2002 20 July 2001 Expires in six months 1 March 2002
Obsoletes: 2253 Obsoletes: 2253
Lightweight Directory Access Protocol (v3): LDAP: String Representation of Distinguished Names
UTF-8 String Representation of Distinguished Names <draft-ietf-ldapbis-dn-07.txt>
<draft-ietf-ldapbis-dn-06.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 1, line 38 skipping to change at page 1, line 37
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as ``work in progress.'' material or to cite them other than as ``work in progress.''
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
<http://www.ietf.org/ietf/1id-abstracts.txt>. The list of <http://www.ietf.org/ietf/1id-abstracts.txt>. The list of
Internet-Draft Shadow Directories can be accessed at Internet-Draft Shadow Directories can be accessed at
<http://www.ietf.org/shadow.html>. <http://www.ietf.org/shadow.html>.
Copyright 2001, The Internet Society. All Rights Reserved. Copyright 2002, The Internet Society. All Rights Reserved.
Please see the Copyright section near the end of this document for Please see the Copyright section near the end of this document for
more information. more information.
Abstract Abstract
The X.500 Directory uses distinguished names as the primary keys to The X.500 Directory uses distinguished names as the primary keys to
entries in the directory. Distinguished Names are encoded in ASN.1 in entries in the directory. Distinguished Names are encoded in ASN.1 in
the X.500 Directory protocols. In the Lightweight Directory Access the X.500 Directory protocols. In the Lightweight Directory Access
Protocol, a string representation of distinguished names is Protocol, a string representation of distinguished names is
skipping to change at page 2, line 22 skipping to change at page 2, line 21
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 (DN). It is important to have a common concept of Distinguished Name (DN). It is important to have a common
format to be able to unambiguously represent a distinguished name. format to be able to unambiguously represent a distinguished name.
The primary goal of this specification is ease of encoding and The primary goal of this specification is ease of encoding and
decoding. A secondary goal is to have names that are human readable. decoding. A secondary goal is to have names that are human readable.
It is not expected that LDAP clients with a human user interface would It is not expected that LDAP clients with a human user interface would
display these strings directly to the user, but would most likely be display these strings directly to the user, but would most likely be
performing translations (such as expressing attribute type names in performing translations (such as expressing attribute type names in
one of the local national languages). one of the local national languages).
This document obsoletes RFC 2253. This document is an integral part of the LDAP Technical Specification
[Roadmap].
This document obsoletes RFC 2253. Changes since RFC 2253 are
summarized in Appendix A.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119]. document are to be interpreted as described in BCP 14 [RFC2119].
2. Converting DistinguishedName from ASN.1 to a String 2. Converting DistinguishedName from ASN.1 to a String
In X.501 [X.501] the ASN.1 structure of distinguished name is defined In X.501 [X.501] the ASN.1 structure of distinguished name is defined
as: as:
DistinguishedName ::= RDNSequence DistinguishedName ::= RDNSequence
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
skipping to change at page 3, line 4 skipping to change at page 3, line 6
AttributeTypeAndValue ::= SEQUENCE { AttributeTypeAndValue ::= SEQUENCE {
type AttributeType, type AttributeType,
value AttributeValue } value AttributeValue }
The following sections define the RECOMMENDED algorithm for converting The following sections define the RECOMMENDED algorithm for converting
from an ASN.1 structured representation to a UTF-8 [RFC2279] string from an ASN.1 structured representation to a UTF-8 [RFC2279] string
representation. representation.
2.1. Converting the RDNSequence 2.1. Converting the RDNSequence
If the RDNSequence is an empty sequence, the result is the empty or If the RDNSequence is an empty sequence, the result is the empty or
zero length string. zero length string.
Otherwise, the output consists of the string encodings of each Otherwise, the output consists of the string encodings of each
RelativeDistinguishedName in the RDNSequence (according to 2.2), RelativeDistinguishedName in the RDNSequence (according to 2.2),
starting with the last element of the sequence and moving backwards starting with the last element of the sequence and moving backwards
toward the first. toward the first.
The encodings of adjoining RelativeDistinguishedNames are separated by The encodings of adjoining RelativeDistinguishedNames are separated by
a comma character (',' ASCII 44). a comma character ("," ASCII 44).
2.2. Converting RelativeDistinguishedName 2.2. Converting RelativeDistinguishedName
When converting from an ASN.1 RelativeDistinguishedName to a string, When converting from an ASN.1 RelativeDistinguishedName to a string,
the output consists of the string encodings of each the output consists of the string encodings of each
AttributeTypeAndValue (according to 2.3), in any order. AttributeTypeAndValue (according to 2.3), in any order.
Where there is a multi-valued RDN, the outputs from adjoining Where there is a multi-valued RDN, the outputs from adjoining
AttributeTypeAndValues are separated by a plus ('+' ASCII 43) AttributeTypeAndValues are separated by a plus ("+" ASCII 43)
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 character ('=' ASCII 61), the AttributeType, followed by an equals character ("=" ASCII 61),
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 in the following table of attribute types
associated with LDAP [RFC2252bis], then the type name string from that associated with LDAP [Schema], then the type name string from that
table is used, otherwise it is encoded as the dotted-decimal encoding table is used, otherwise it is encoded as the dotted-decimal encoding
of the AttributeType's OBJECT IDENTIFIER. The dotted-decimal notation of the AttributeType's OBJECT IDENTIFIER. The dotted-decimal notation
is described in [RFC2251bis]. (numericoid) is described in [Models].
The type name string is not case sensitive. The type name string is not case sensitive.
String X.500 AttributeType String X.500 AttributeType
------ -------------------------------------------- ------ --------------------------------------------
CN commonName (2.5.4.3) CN commonName (2.5.4.3)
L localityName (2.5.4.7) L localityName (2.5.4.7)
ST stateOrProvinceName (2.5.4.8) ST stateOrProvinceName (2.5.4.8)
O organizationName (2.5.4.10) O organizationName (2.5.4.10)
OU organizationalUnitName (2.5.4.11) OU organizationalUnitName (2.5.4.11)
C countryName (2.5.4.6) C countryName (2.5.4.6)
STREET streetAddress (2.5.4.9) STREET streetAddress (2.5.4.9)
DC domainComponent (0.9.2342.19200300.100.1.25) DC domainComponent (0.9.2342.19200300.100.1.25)
UID userId (0.9.2342.19200300.100.1.1) UID userId (0.9.2342.19200300.100.1.1)
2.4. Converting an AttributeValue from ASN.1 to a String 2.4. Converting an AttributeValue from ASN.1 to a String
If the AttributeValue is of a type which does not have a string If the AttributeValue is of a type which does not have a string
representation defined for it, then it is simply encoded as an representation defined for it, then it is simply encoded as an
octothorpe character ('#' ASCII 35) followed by the hexadecimal octothorpe character ("#" ASCII 35) followed by the hexadecimal
representation of each of the octets of the BER encoding of the X.500 representation of each of the octets of the BER encoding of the X.500
AttributeValue. This form is also be used if the AttributeType is of AttributeValue. This form is also be used if the AttributeType is of
the dotted-decimal form. the dotted-decimal form.
Otherwise, if the AttributeValue is of a type which has a string Otherwise, if the AttributeValue is of a type which has a string
representation, the value is converted first to a UTF-8 string representation, the value is converted first to a UTF-8 string
according to its syntax specification (see for example Section 6 of according to its syntax specification (see for example Section 6 of
[RFC2252bis]). [Syntaxes]).
If the UTF-8 string does not have any of the following characters If the UTF-8 string does not have any of the following characters
which need escaping, then that string can be used as the string which need escaping, then that string can be used as the string
representation of the value. representation of the value.
- a space (' ' ASCII 32) or octothorpe ('#' ASCII 35) occurring at - a space (" " ASCII 32) or octothorpe ("#" ASCII 35) occurring at
the beginning of the string the beginning of the string
- a space (' ' ASCII 32) character occurring at the end of the - a space (" " ASCII 32) character occurring at the end of the
string string
- one of the characters ",", "+", """, "\", "<", ">" or ";" (ASCII - one of the characters ",", "+", """, "\", "<", ">" or ";" (ASCII
44, 43, 34, 92, 60, 62, or 59, respectively) 44, 43, 34, 92, 60, 62, or 59, respectively)
- the null (ASCII 0) character - the null (ASCII 0) character
Implementations can escape other characters. Implementations MAY escape other characters.
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 " "
(ASCII 44, 43, 34, 92, 60, 62, 59, 35, or 32, respectively) (ASCII 44, 43, 34, 92, 60, 62, 59, 35, 61 or 32 respectively)
it can be prefixed by a backslash ('\' ASCII 92). it can be prefixed by a backslash ("\" ASCII 92).
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 structure of the UTF-8 [RFC2279] string is specified using the The structure of the UTF-8 [RFC2279] string is specified using the
following Augmented BNF [RFC2234] grammar. following Augmented BNF [RFC2234] grammar.
distinguishedName = [name] distinguishedName = [name]
; may be empty ; may be empty
name = name-component *(COMMA name-component) name = name-component *(COMMA name-component)
name-component = attributeTypeAndValue *(PLUS attributeTypeAndValue) name-component = attributeTypeAndValue *(PLUS attributeTypeAndValue)
skipping to change at page 7, line 14 skipping to change at page 7, line 18
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
letters: letters:
Unicode Letter Description 10646 code UTF-8 Quoted Unicode Letter Description 10646 code UTF-8 Quoted
=============================== ========== ====== ======= =============================== ========== ====== =======
LATIN CAPITAL LETTER L U0000004C 0x4C L LATIN CAPITAL LETTER L U+0000004C 0x4C L
LATIN SMALL LETTER U U00000075 0x75 u LATIN SMALL LETTER U U+00000075 0x75 u
LATIN SMALL LETTER C WITH CARON U0000010D 0xC48D \C4\8D LATIN SMALL LETTER C WITH CARON U+0000010D 0xC48D \C4\8D
LATIN SMALL LETTER I U00000069 0x69 i LATIN SMALL LETTER I U+00000069 0x69 i
LATIN SMALL LETTER C WITH ACUTE U00000107 0xC487 \C4\87 LATIN SMALL LETTER C WITH ACUTE U+00000107 0xC487 \C4\87
could be written in printable ASCII (useful for debugging purposes): could be written in printable ASCII (useful for debugging purposes):
CN=Lu\C4\8Di\C4\87 CN=Lu\C4\8Di\C4\87
5. Security Considerations 5. Security Considerations
The following security considerations are specific to the handling of The following security considerations are specific to the handling of
distinguished names. LDAP security considerations are discussed in distinguished names. LDAP security considerations are discussed in
[RFC2251bis] and its normative references. [Protocol] and other documents comprising the LDAP Technical
Specification [Roadmap].
5.1. Disclosure 5.1. Disclosure
Distinguished Names typically consist of descriptive information about Distinguished Names typically consist of descriptive information about
the entries they name, which can be people, organizations, devices or the entries they name, which can be people, organizations, devices or
other real-world objects. This frequently includes some of the other real-world objects. This frequently includes some of the
following kinds of information: following kinds of information:
- the common name of the object (i.e. a person's full name) - the common name of the object (i.e. a person's full name)
- an email or TCP/IP address - an email or TCP/IP address
skipping to change at page 8, line 30 skipping to change at page 8, line 35
5.3. Use of Other Names 5.3. Use of Other Names
Attribute type names are not unique. A string representation Attribute type names are not unique. A string representation
generated with names other than those in the Section 2.3 table is generated with names other than those in the Section 2.3 table is
ambiguous. That is, two applications may recognize the string as ambiguous. That is, two applications may recognize the string as
representing two different DNs possibly associated with two different representing two different DNs possibly associated with two different
entries. This may lead to a wide range of unexpected behaviors which entries. This may lead to a wide range of unexpected behaviors which
can have both direct and indirect impacts upon security. can have both direct and indirect impacts upon security.
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 known locally as FOO and the value is of the of the known locally attribute type FOO and the value "BAR" (an
octetString "BAR" could be represented in LDAP as the string FOO=BAR. octetString) could be represented in LDAP as the string FOO=BAR. As
As the name FOO does not uniquely identify an attribute type, the DN the name FOO does not uniquely identify an attribute type, the DN
FOO=BAR is ambiguous. That is, FOO could be recognized as the 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 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 recognized by another. This may lead to operations not behaving as
intended. intended.
Applications desiring to generate an unambiguous string representation Applications desiring to generate an unambiguous string representation
of a DN SHOULD generate string representation per section 2, not use 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 5.2 names other than those in the Section 2.3 table, and while taking 5.2
into consideration. into consideration.
skipping to change at page 9, line 11 skipping to change at page 9, line 15
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
OpenLDAP Foundation OpenLDAP Foundation
<Kurt@OpenLDAP.org> <Kurt@OpenLDAP.org>
References 8. Normative References
[X.500] "The Directory -- overview of concepts, models and
services," ITU-T Rec. X.500(1993).
[X.501] "The Directory -- Models," ITU-T Rec. X.501(1993). [X.501] "The Directory -- Models," ITU-T Rec. X.501(1993).
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", RFC 2119. Requirement Levels", RFC 2119.
[RFC2234] Crocker, D., and P. Overell, "Augmented BNF for Syntax [RFC2234] Crocker, D., and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 2234, November 1997. Specifications: ABNF", RFC 2234, November 1997.
[RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO
10646", RFC 2279, January 1998. 10646", RFC 2279, January 1998.
[RFC2251bis] LDAPbis WG, "Lightweight Directory Access Protocol (v3)", [Models] K. Zeilenga (editor), "LDAP: Directory Information
a work in progress. Models", draft-ietf-ldapbis-models-xx.txt, a work in
progress.
[RFC2252bis] LDAPbis WG, "LDAPv3: Attribute Syntax Definitions", a [Roadmap] K. Zeilenga (editor), "LDAP: Technical Specification Road
work in progress. Map", draft-ietf-ldapbis-roadmap-xx.txt, a work in
progress.
[RFC2256bis] LDAPbis WG, "LDAPv3: User Schema", a work in progress. [Protocol] J. Sermersheim (editor), "LDAP: The Protocol",
draft-ietf-ldapbis-protocol-xx.txt, a work in progress.
[Syntaxes] K. Dally (editor), "LDAP: Syntaxes",
draft-ietf-ldapbis-syntaxes-xx.txt, a work in progress.
[Schema] K. Dally (editor), "LDAP: User Schema",
draft-ietf-ldapbis-user-schema-xx.txt, a work in
progress.
9. Informative References
[X.500] "The Directory -- overview of concepts, models and
services," ITU-T Rec. X.500(1993).
Appendix A. Changes made since RFC 2253 Appendix A. 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 is addressed by RFC 2829. - Removed IESG Note. The IESG Note is addressed by RFC 2829.
- Replaced specification of additional requirements for LDAPv2 - Replaced specification of additional requirements for LDAPv2
implementations which also support LDAPv3 (Section 4) with a implementations which also support LDAPv3 (Section 4) with a
skipping to change at page 10, line 18 skipping to change at page 10, line 35
clarified escaping for when multiple octet UTF-8 characters are clarified escaping for when multiple octet UTF-8 characters are
present. present.
- Rewrote Section 3 to use ABNF as defined in RFC 2234. - Rewrote Section 3 to use ABNF as defined in RFC 2234.
- Rewrote Section 3 ABNF to be consistent with 2.4. - Rewrote Section 3 ABNF to be consistent with 2.4.
- Rewrote examples. - Rewrote examples.
- Added reference to documentations containing LDAP-specific - Added reference to documentations containing LDAP-specific
security considerations. security considerations.
In addition, numerous editorial changes were made. In addition, numerous editorial changes were made.
Copyright 2001, The Internet Society. All Rights Reserved. Copyright 2002, The Internet Society. All Rights Reserved.
This document and translations of it may be copied and furnished to This document and translations of it may be copied and furnished to
others, and derivative works that comment on or otherwise explain it others, and derivative works that comment on or otherwise explain it
or assist in its implementation may be prepared, copied, published and or assist in its implementation may be prepared, copied, published and
distributed, in whole or in part, without restriction of any kind, distributed, in whole or in part, without restriction of any kind,
provided that the above copyright notice and this paragraph are provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of Internet organizations, except as needed for the purpose of
 End of changes. 

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