draft-ietf-ldapbis-dn-03.txt   draft-ietf-ldapbis-dn-04.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: 1 October 2001 1 April 2001 Expires: 18 October 2001 18 April 2001
Obsoletes: 2253 Obsoletes: 2253
Lightweight Directory Access Protocol (v3): Lightweight Directory Access Protocol (v3):
UTF-8 String Representation of Distinguished Names UTF-8 String Representation of Distinguished Names
<draft-ietf-ldapbis-dn-03.txt> <draft-ietf-ldapbis-dn-04.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
Revision Working Group (LDAPbis) mailing list Revision Working Group mailing list <ietf-ldapbis@openldap.org>.
<ietf-ldapbis@openldap.org>. Please send editorial comments directly Please send editorial comments directly to the document editor
to the document editor <Kurt@OpenLDAP.org>. <Kurt@OpenLDAP.org>.
Internet-Drafts are working documents of the Internet Engineering Task Internet-Drafts are working documents of the Internet Engineering Task
Force (IETF), its areas, and its working groups. Note that other Force (IETF), its areas, and its working groups. Note that other
groups may also distribute working documents as Internet-Drafts. groups may also distribute working documents as Internet-Drafts.
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 Internet-Draft <http://www.ietf.org/ietf/1id-abstracts.txt>. The list of
Shadow Directories can be accessed at http://www.ietf.org/shadow.html. Internet-Draft Shadow Directories can be accessed at
<http://www.ietf.org/shadow.html>.
Copyright 2001, The Internet Society. All Rights Reserved. Copyright 2001, 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
skipping to change at page 3, line 33 skipping to change at page 3, line 30
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 [RFC2252bis], 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]. is described in [RFC2251bis].
The type name string is not case sensitive. The type name string is not case sensitive.
String X.500 AttributeType String X.500 AttributeType
skipping to change at page 4, line 19 skipping to change at page 4, line 17
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 SHOULD be used if the AttributeType is of AttributeValue. This form SHOULD 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]). [RFC2252bis]).
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 the - a space (' ' ASCII 32) or octothorpe ('#' ASCII 35) occurring at
beginning of the string the beginning of the string
- a space (' ' ASCII 32) character occurring at the end of the string - a space (' ' ASCII 32) character occurring at the end of the
string
- one of the characters ",", "+", """, "\", "<", ">" or ";" (ASCII 44, - one of the characters ",", "+", """, "\", "<", ">" or ";" (ASCII
43, 34, 92, 60, 62, or 59, respectively) 44, 43, 34, 92, 60, 62, or 59, respectively)
Implementations MAY 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, or 32, respectively)
it may be prefixed by a backslash ('\' ASCII 92). it may 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)
skipping to change at page 5, line 37 skipping to change at page 5, line 33
number = ( LDIGIT *DIGIT ) / DIGIT number = ( LDIGIT *DIGIT ) / DIGIT
attributeValue = string / hexstring attributeValue = string / hexstring
string = *( stringchar / pair ) string = *( stringchar / pair )
; the string MUST NOT start with SHARP or SP ; the string MUST NOT start with SHARP or SP
; and MUST NOT end with SP ; and MUST NOT end with SP
stringchar = <any UTF-8 character (can be multiple octets) stringchar = <any UTF-8 character (can be multiple octets)
excepting escaped or ESC> except one of escaped or ESC>
pair = ESC ( ESC / special / hexpair ) pair = ESC ( ESC / special / hexpair )
special = escaped / SHARP / EQUALS / SP special = escaped / SHARP / EQUALS / SP
escaped = COMMA / PLUS / %x22 / %x3C / %x3E / %3B escaped = COMMA / PLUS / %x22 / %x3C / %x3E / %3B
; "," / "+" / """ / "<" / ">" / ";" ; "," / "+" / """ / "<" / ">" / ";"
hexstring = SHARP 1*hexpair hexstring = SHARP 1*hexpair
skipping to change at page 6, line 23 skipping to change at page 6, line 20
SP = %x20 ; space (" ") SP = %x20 ; space (" ")
SHARP = %x23 ; sharp sign ("#") SHARP = %x23 ; sharp sign ("#")
PLUS = %x2B ; plus sign ("+") PLUS = %x2B ; plus sign ("+")
COMMA = %x2C ; comma (",") COMMA = %x2C ; comma (",")
MINUS = %x2D ; minus sign ("-") MINUS = %x2D ; minus sign ("-")
DOT = %x2E ; period (".") DOT = %x2E ; period (".")
EQUALS = %x3D ; equals sign ("=") EQUALS = %x3D ; equals sign ("=")
ESC = %x5C ; backslash ("\") ESC = %x5C ; backslash ("\")
Implementations MUST recognize AttributeType string type names Implementations MUST recognize AttributeType string type names
(keywords) listed in the Section 2 table, but MAY recognize other (keywords) listed in the Section 2.3 table, but MAY recognize other
names (keywords). Implementations MAY recognize other DN string names. Implementations MAY recognize other DN string representations
representations (such as that described in RFC 1779) but SHALL only (such as that described in RFC 1779). As there is no requirement for
generate DN strings in accordance with Section 2 of this document. other names or alternative DN string representations be recognized,
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 name.
This section gives a few examples of distinguished names written using This section gives a few examples of distinguished names written using
this notation. First is a name containing three relative this notation. First is a name containing three relative
distinguished names (RDNs): distinguished names (RDNs):
UID=jsmith,DC=example,DC=net UID=jsmith,DC=example,DC=net
skipping to change at page 8, line 19 skipping to change at page 8, line 18
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 octothorpe ('#') they SHOULD use the hexadecimal form prefixed by the octothorpe ('#')
as described in the first paragraph of section 2.4. as described in the first paragraph of Section 2.3.
6. References 5.3. Use of Other Names
Attribute type names are not unique. A string representation
generated with names other than those in 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 impact upon security.
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
octetString "BAR" could be represented in LDAP as the string FOO=BAR.
As the name FOO does not uniquely identify an attribute type, the DN
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 5.2
into consideration.
6. Acknowledgment
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.
This document is a product of the IETF LDAPbis Working Group.
7. Document Editor's Address
Kurt D. Zeilenga
OpenLDAP Foundation
<Kurt@OpenLDAP.org>
References
[X.500] "The Directory -- overview of concepts, models and [X.500] "The Directory -- overview of concepts, models and
services," ITU-T Rec. X.500(1993). 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
skipping to change at page 8, line 45 skipping to change at page 9, line 35
10646", RFC 2279, January 1998. 10646", RFC 2279, January 1998.
[RFC2251bis] LDAPbis WG, "Lightweight Directory Access Protocol (v3)", [RFC2251bis] LDAPbis WG, "Lightweight Directory Access Protocol (v3)",
a work in progress. a work in progress.
[RFC2252bis] LDAPbis WG, "LDAPv3: Attribute Syntax Definitions", a [RFC2252bis] LDAPbis WG, "LDAPv3: Attribute Syntax Definitions", a
work in progress. work in progress.
[RFC2256bis] LDAPbis WG, "LDAPv3: User Schema", a work in progress. [RFC2256bis] LDAPbis WG, "LDAPv3: User Schema", a work in progress.
7. Acknowledgment
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.
This document is a product of the IETF LDAPbis Working Group.
8. Document Editor's Address
Kurt D. Zeilenga
OpenLDAP Foundation
<Kurt@OpenLDAP.org>
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
statement (in Section 3) allowing recognization of alternative statement (in Section 3) allowing recognition of alternative
string representations. string representations.
- Updated 2.3 to clarify which table is the published table of names - Updated 2.3 to clarify which table is the published table of names
which may be appear in DNs. Remove "as an example" language. which may be appear in DNs. Remove "as an example" language.
Added statement (in Section 3) allowing recognization of Added statement (in Section 3) allowing recognition of additional
additional names. - Updated 2.3 to indicate attribute type name names. Added security consideration (Section 5.3) regarding the
strings are not case sensitive. use of other names.
- Updated 2.3 to indicate attribute type name strings are not case
sensitive.
- Updated 2.4 to allow hex pair escaping of all characters and - Updated 2.4 to allow hex pair escaping of all characters and
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.
 End of changes. 

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