home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_a_c / draft-ietf-asid-ldapv3-protocol-07.txt < prev    next >
Text File  |  1997-08-21  |  111KB  |  2,576 lines

  1.  
  2. Network Working Group                                            M. Wahl
  3. INTERNET-DRAFT                                       Critical Angle Inc.
  4. Replaces: RFC 1777                                              T. Howes
  5.                                            Netscape Communications Corp.
  6.                                                                 S. Kille
  7.                                                            Isode Limited
  8. Expires in six months from                                 5 August 1997
  9. Intended Category: Standards Track
  10.  
  11.  
  12.                   Lightweight Directory Access Protocol (v3)
  13.                   <draft-ietf-asid-ldapv3-protocol-07.txt>
  14.  
  15.  
  16. Table of Contents - see end of document.
  17.  
  18. 1.  Status of this Memo
  19.  
  20.    This document is an Internet-Draft.  Internet-Drafts are working 
  21.    documents of the Internet Engineering Task Force (IETF), its areas, and
  22.    its working groups.  Note that other groups may also distribute working
  23.    documents as Internet-Drafts.
  24.  
  25.    Internet-Drafts are draft documents valid for a maximum of six months
  26.    and may be updated, replaced, or obsoleted by other documents at any
  27.    time.  It is inappropriate to use Internet-Drafts as reference material
  28.    or to cite them other than as "work in progress."
  29.  
  30.    To learn the current status of any Internet-Draft, please check the
  31.    "1id-abstracts.txt" listing  contained in the Internet-Drafts Shadow
  32.    Directories on ds.internic.net (US East Coast), nic.nordu.net (Europe),
  33.    ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim).
  34.  
  35. 2.  Abstract
  36.  
  37.    The protocol described in this document is designed to provide access
  38.    to directories supporting the X.500 models, while not incurring the 
  39.    resource requirements of the X.500 Directory Access Protocol (DAP). 
  40.    This protocol is specifically targeted at management applications and 
  41.    browser applications that provide read/write interactive access to 
  42.    directories. When used with a directory supporting the X.500 
  43.    protocols, it is intended to be a complement to the X.500 DAP.
  44.  
  45.    Key aspects of this version of LDAP are:
  46.  
  47.    - All protocol elements of LDAPv2 (RFC 1777) are supported. The 
  48.      protocol is carried directly over TCP or other transport, bypassing 
  49.      much of the session/presentation overhead of X.500 DAP.  
  50.  
  51.    - Most protocol data elements can be encoded as ordinary strings 
  52.      (e.g., Distinguished Names).
  53.  
  54.    - Referrals to other servers may be returned.
  55.  
  56.  
  57.  
  58.  
  59. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 1
  60.  
  61. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  62.  
  63.  
  64.    - SASL and TLS mechanisms may be used with LDAP to provide association
  65.      security services.
  66.  
  67.    - Attribute values and Distinguished Names have been internationalized
  68.      through the use of the ISO 10646 character set.
  69.  
  70.    - The protocol can be extended to support new operations, and controls
  71.      may be used to extend existing operations.
  72.  
  73.    - Schema is published in the directory for use by clients. 
  74.  
  75. 3.  Models
  76.  
  77.    Interest in X.500 [1] directory technologies in the Internet has led 
  78.    to efforts to reduce the high cost of entry associated with use of 
  79.    these technologies.  This document continues the efforts to define 
  80.    directory protocol alternatives, updating the LDAP [2] protocol 
  81.    specification. 
  82.  
  83. 3.1. Protocol Model
  84.  
  85.    The general model adopted by this protocol is one of clients
  86.    performing protocol operations against servers. In this model, a
  87.    client transmits a protocol request describing the operation to be 
  88.    performed to a server. The server is then responsible for performing 
  89.    the necessary operation(s) in the directory. Upon completion of 
  90.    the operation(s), the server returns a response containing any results
  91.    or errors to the requesting client.
  92.  
  93.    In keeping with the goal of easing the costs associated with use of
  94.    the directory, it is an objective of this protocol to minimize the
  95.    complexity of clients so as to facilitate widespread deployment of
  96.    applications capable of using the directory.
  97.  
  98.    Note that although servers are required to return responses whenever
  99.    such responses are defined in the protocol, there is no requirement
  100.    for synchronous behavior on the part of either clients or servers.
  101.    Requests and responses for multiple operations may be exchanged 
  102.    between a client and server in any order, provided the client
  103.    eventually receives a response for every request that requires one.
  104.  
  105.    In LDAP versions 1 and 2, no provision was made for protocol servers
  106.    returning referrals to clients.  However, for improved performance and
  107.    distribution this version of the protocol permits servers to return to
  108.    clients referrals to other servers.  This allows servers to offload 
  109.    the work of contacting other servers to progress operations.
  110.  
  111.    Note that the core protocol operations defined in this document can be
  112.    mapped to a strict subset of the X.500(1997) directory abstract 
  113.    service, so it can be cleanly provided by the DAP.  However there is 
  114.    not a one-to-one mapping between LDAP protocol operations and DAP 
  115.    operations: server implementations acting as a gateway to X.500 
  116.    directories may need to make multiple DAP requests.
  117.  
  118.  
  119. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 2
  120.  
  121. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  122.  
  123. 3.2. Data Model 
  124.  
  125.    This section provides a brief introduction to the X.500 data model, as
  126.    used by LDAP. 
  127.  
  128.    The LDAP protocol assumes there are one or more servers which jointly 
  129.    provide access to a Directory Information Tree (DIT).  The tree is 
  130.    made up of entries.  Entries have names: one or more attribute values 
  131.    from the entry form its relative distinguished name (RDN), which MUST 
  132.    be unique among all its siblings.  The concatenation of the relative 
  133.    distinguished names of the sequence of entries from a particular 
  134.    entry to an immediate subordinate of the root of the tree forms that 
  135.    entry's Distinguished Name (DN), which is unique in the tree.  An 
  136.    example of a Distinguished Name is 
  137.  
  138.    CN=Steve Kille, O=Isode Limited, C=GB
  139.  
  140.    Some servers may hold cache or shadow copies of entries, which can be 
  141.    used to answer search and comparison queries, but will return 
  142.    referrals or contact other servers if modification operations are 
  143.    requested.
  144.  
  145.    Servers which perform caching or shadowing MUST ensure that they do 
  146.    not violate any access control constraints placed on the data by the 
  147.    originating server.
  148.  
  149.    The largest collection of entries, starting at an entry that is 
  150.    mastered by a particular server, and including all its subordinates 
  151.    and their subordinates, down to the entries which are mastered by 
  152.    different servers, is termed a naming context.  The root of the DIT 
  153.    is a DSA-specific Entry (DSE) and not part of any naming context: 
  154.    each server has different attribute values in the root DSE.  (DSA is
  155.    an X.500 term for the directory server).
  156.    
  157. 3.2.1. Attributes of Entries
  158.  
  159.    Entries consist of a set of attributes.  An attribute is a type with 
  160.    one or more associated values.  The attribute type is identified by a 
  161.    short descriptive name and an OID (object identifier). The attribute
  162.    type governs whether there can be more than one value of an 
  163.    attribute of that type in an entry, the syntax to which the values 
  164.    must conform, the kinds of matching which can be performed on values 
  165.    of that attribute, and other functions.
  166.  
  167.    An example of an attribute is "mail". There may be one or more values 
  168.    of this attribute, they must be IA5 (ASCII) strings, and they are 
  169.    case insensitive (e.g. "foo@bar.com" will match "FOO@BAR.COM").
  170.  
  171.    Schema is the collection of attribute type definitions, object class
  172.    definitions and other information which a server uses to determine
  173.    how to match a filter or attribute value assertion (in a compare 
  174.    operation) against the attributes of an entry, and whether to permit 
  175.    add and modify operations.  The definition of schema for use with 
  176.    LDAP is given in [5] and [6].  Additional schema elements may be 
  177.    defined in other documents.
  178.  
  179. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 3
  180.  
  181. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  182.  
  183.    Each entry MUST have an objectClass attribute.  The objectClass 
  184.    attribute specifies the object classes of an entry, which along with 
  185.    the system and user schema determine the permitted attributes of an 
  186.    entry.  Values of this attribute may be modified by clients, but the
  187.    objectClass attribute cannot be removed.  Servers may restrict the
  188.    modifications of this attribute to prevent the basic structural
  189.    class of the entry from being changed (e.g. one cannot change a
  190.    person into a country).  When creating an entry or adding an 
  191.    objectClass value to an entry, all superclasses of the named classes
  192.    are implicitly added as well if not already present, and the client 
  193.    must supply values for any mandatory attributes of new superclasses.
  194.  
  195.    Some attributes, termed operational attributes, are used by servers 
  196.    for administering the directory system itself.  They are not returned 
  197.    in search results unless explicitly requested by name.  Attributes 
  198.    which are not operational, such as "mail", will have their schema and 
  199.    syntax constraints enforced by servers, but servers will generally 
  200.    not make use of their values.
  201.  
  202.    Servers MUST NOT permit clients to add attributes to an entry unless 
  203.    those attributes are permitted by the object class definitions, the 
  204.    schema controlling that entry (specified in the subschema - see
  205.    below), or are operational attributes known to that server and used 
  206.    for administrative purposes.  Note that there is a particular 
  207.    objectClass 'extensibleObject' defined in [5] which permits all user 
  208.    attributes to be present in an entry.
  209.  
  210.    Entries MAY contain, among others, the following operational 
  211.    attributes, defined in [5]. These attributes are maintained 
  212.    automatically by the server and are not modifiable by clients:
  213.  
  214.    - creatorsName: the Distinguished Name of the user who added this 
  215.      entry to the directory.
  216.  
  217.    - createTimestamp: the time this entry was added to the directory.
  218.  
  219.    - modifiersName: the Distinguished Name of the user who last modified 
  220.      this entry.
  221.  
  222.    - modifyTimestamp: the time this entry was last modified.
  223.  
  224.    - subschemaSubentry:  the Distinguished Name of the subschema entry 
  225.      (or subentry) which controls the schema for this entry.
  226.  
  227. 3.2.2. Subschema Entries and Subentries
  228.         
  229.    Subschema entries are used for administering information about the 
  230.    directory schema, in particular the object classes and attribute types
  231.    supported by directory servers.  A single subschema entry contains 
  232.    all schema definitions used by entries in a particular part of the 
  233.    directory tree.
  234.  
  235.  
  236.  
  237.  
  238.  
  239. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 4
  240.  
  241. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  242.  
  243.    Servers which follow X.500(93) models SHOULD implement subschema 
  244.    using the X.500 subschema mechanisms, and so these subschemas are not
  245.    ordinary entries.  LDAP clients SHOULD NOT assume that servers 
  246.    implement any of the other aspects of X.500 subschema.
  247.    A server which masters entries and permits clients to modify these 
  248.    entries MUST implement and provide access to these subschema entries,
  249.    so that its clients may discover the attributes and object classes 
  250.    which are permitted to be present. It is strongly recommended that 
  251.    all other servers implement this as well.
  252.  
  253.    The following four attributes MUST be present in all subschema 
  254.    entries:
  255.  
  256.    - cn: this attribute MUST be used to form the RDN of the subschema 
  257.      entry.
  258.  
  259.    - objectClass: the attribute MUST have at least the values "top" and 
  260.      "subschema".
  261.  
  262.    - objectClasses: each value of this attribute specifies an object 
  263.      class known to the server.
  264.  
  265.    - attributeTypes: each value of this attribute specifies an attribute
  266.      type known to the server.
  267.  
  268.    These are defined in [5]. Other attributes MAY be present in subschema
  269.    entries, to reflect additional supported capabilities. These include
  270.    matchingRules, matchingRuleUse, dITStructureRules, dITContentRules, 
  271.    nameForms and ldapSyntaxes.
  272.  
  273.    Servers SHOULD provide the attributes createTimestamp and 
  274.    modifyTimestamp in subschema entries, in order to allow clients to 
  275.    maintain their caches of schema information. 
  276.  
  277.    Clients MUST only retrieve attributes from a subschema entry by 
  278.    requesting a base object search of the entry, where the search filter 
  279.    is "(objectClass=subschema)". (This will allow LDAPv3 servers which 
  280.    gateway to X.500(93) to detect that subentry information is being 
  281.    requested.)
  282.  
  283. 3.3. Relationship to X.500
  284.  
  285.    This document defines LDAP in terms of X.500 as an X.500 access 
  286.    mechanism.  An LDAP server MUST act in accordance with the 
  287.    X.500(1993) series of ITU recommendations when providing the service. 
  288.    However, it is not required that an LDAP server make use of any X.500 
  289.    protocols in providing this service, e.g. LDAP can be mapped onto any 
  290.    other directory system so long as the X.500 data and service model as
  291.    used in LDAP is not violated in the LDAP interface.
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 5
  300.  
  301. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  302.  
  303. 3.4. Server-specific Data Requirements
  304.  
  305.    An LDAP server MUST provide information about itself and other 
  306.    information that is specific to each server.  This is represented as 
  307.    a group of attributes located in the root DSE (DSA-Specific Entry), 
  308.    which is named with the zero-length LDAPDN.  These attributes 
  309.    are retrievable if a client performs a base object search of the 
  310.    root with filter "(objectClass=*)", however they are subject to 
  311.    access control restrictions.
  312.    The root DSE MUST NOT be included if the client performs a subtree 
  313.    search starting from the root.  
  314.  
  315.    Servers may allow clients to modify these attributes.
  316.  
  317.    The following attributes of the root DSE are defined in section 5
  318.    of [5].  Additional attributes may be defined in other documents.
  319.  
  320.    - namingContexts: naming contexts held in the server. Naming contexts
  321.      are defined in section 17 of X.501 [6].
  322.  
  323.    - subschemaSubentry: subschema entries (or subentries) known by this 
  324.      server.
  325.  
  326.    - altServer: alternative servers in case this one is later 
  327.      unavailable.
  328.  
  329.    - supportedExtension: list of supported extended operations.
  330.  
  331.    - supportedControl: list of supported controls.
  332.  
  333.    - supportedSASLMechanisms: list of supported SASL security features. 
  334.  
  335.    - supportedLDAPVersion: LDAP versions implemented by the server.
  336.  
  337.    If the server does not master entries and does not know the locations
  338.    of schema information, the subschemaSubentry attribute is not present 
  339.    in the root DSE.  If the server masters directory entries under one or
  340.    more schema rules, there may be any number of values of the 
  341.    subschemaSubentry attribute in the root DSE. 
  342.  
  343. 4.  Elements of Protocol
  344.  
  345.    The LDAP protocol is described using Abstract Syntax Notation 1 
  346.    (ASN.1) [3], and is typically transferred using a subset of ASN.1 
  347.    Basic Encoding Rules [11]. In order to support future extensions to 
  348.    this protocol, clients and servers MUST ignore elements of SEQUENCE 
  349.    encodings whose tags they do not recognize.
  350.  
  351.    Note that unlike X.500, each change to the LDAP protocol other than 
  352.    through the extension mechanisms will have a different version 
  353.    number.  A client will indicate the version it supports as part of 
  354.    the bind request, described in section 4.2.  If a client has not sent 
  355.    a bind, the server MUST assume that version 3 is supported in the 
  356.    client (since version 2 required that the client bind first).  
  357.  
  358.  
  359. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 6
  360.  
  361. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  362.   
  363.    Clients may determine the protocol version a server supports by 
  364.    reading the supportedLDAPVersion attribute from the root DSE.  
  365.    Servers which implement version 3 or later versions MUST provide this 
  366.    attribute.  Servers which only implement version 2 may not provide 
  367.    this attribute.
  368.  
  369. 4.1. Common Elements
  370.  
  371.    This section describes the LDAPMessage envelope PDU (Protocol Data
  372.    Unit) format, as well as data type definitions which are used in the 
  373.    protocol operations.
  374.  
  375. 4.1.1. Message Envelope 
  376.  
  377.    For the purposes of protocol exchanges, all protocol operations are
  378.    encapsulated in a common envelope, the LDAPMessage, which is defined
  379.    as follows:
  380.  
  381.         LDAPMessage ::= SEQUENCE {
  382.                 messageID       MessageID,
  383.                 protocolOp      CHOICE {
  384.                         bindRequest     BindRequest,
  385.                         bindResponse    BindResponse, 
  386.                         unbindRequest   UnbindRequest, 
  387.                         searchRequest   SearchRequest, 
  388.                         searchResEntry  SearchResultEntry, 
  389.                         searchResDone   SearchResultDone, 
  390.                         searchResRef    SearchResultReference, 
  391.                         modifyRequest   ModifyRequest, 
  392.                         modifyResponse  ModifyResponse, 
  393.                         addRequest      AddRequest,     
  394.                         addResponse     AddResponse,    
  395.                         delRequest      DelRequest, 
  396.                         delResponse     DelResponse,    
  397.                         modDNRequest    ModifyDNRequest, 
  398.                         modDNResponse   ModifyDNResponse, 
  399.                         compareRequest  CompareRequest, 
  400.                         compareResponse CompareResponse, 
  401.                         abandonRequest  AbandonRequest,  
  402.                         extendedReq     ExtendedRequest,
  403.                         extendedResp    ExtendedResponse },
  404.                  controls       [0] Controls OPTIONAL }
  405.  
  406.         MessageID ::= INTEGER (0 .. maxInt)
  407.  
  408.         maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) --
  409.  
  410.    The function of the LDAPMessage is to provide an envelope containing
  411.    common fields required in all protocol exchanges. At this time the
  412.    only common fields are the message ID and the controls.
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 7
  420.  
  421. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  422.  
  423.    If the server receives a PDU from the client in which the LDAPMessage 
  424.    SEQUENCE tag cannot be recognized, the messageID cannot be parsed, 
  425.    the tag of the protocolOp is not recognized as a request, or the 
  426.    encoding structures or lengths of data fields are found to be 
  427.    incorrect, then the server MUST return the notice of disconnection 
  428.    described in section 4.4.1, with resultCode protocolError, and 
  429.    immediately close the connection. In other cases that the server 
  430.    cannot parse the request received by the client, the server MUST 
  431.    return an appropriate response to the request, with the resultCode 
  432.    set to protocolError.
  433.  
  434.    If the client receives a PDU from the server which cannot be parsed,
  435.    the client may discard the PDU, or may abruptly close the connection.
  436.  
  437.    The ASN.1 type Controls is defined in section 4.1.12.
  438.  
  439. 4.1.1.1. Message ID
  440.  
  441.    All LDAPMessage envelopes encapsulating responses contain the 
  442.    messageID value of the corresponding request LDAPMessage.
  443.  
  444.    The message ID of a request MUST have a value different from the 
  445.    values of any other requests outstanding in the LDAP session of which 
  446.    this message is a part.  
  447.  
  448.    A client MUST NOT send a second request with the same message ID as 
  449.    an earlier request on the same connection if the client has not 
  450.    received the final response from the earlier request.  Otherwise the 
  451.    behavior is undefined.  Typical clients increment a counter for each 
  452.    request. 
  453.  
  454.    A client MUST NOT reuse the message id of an abandonRequest or of the 
  455.    abandoned operation until it has received a response from the server 
  456.    for another request invoked subsequent to the abandonRequest, as the 
  457.    abandonRequest itself does not have a response.
  458.  
  459. 4.1.2. String Types
  460.  
  461.    The LDAPString is a notational convenience to indicate that, although
  462.    strings of LDAPString type encode as OCTET STRING types, the ISO 10646
  463.    [13] character set (a superset of Unicode) is used, encoded following 
  464.    the UTF-8 algorithm [14]. Note that in the UTF-8 algorithm characters 
  465.    which are the same as ASCII (0x0000 through 0x007F) are represented 
  466.    as that same ASCII character in a single byte.  The other byte values 
  467.    are used to form a variable-length encoding of an arbitrary character.
  468.  
  469.         LDAPString ::= OCTET STRING
  470.  
  471.    The LDAPOID is a notational convenience to indicate that the permitted
  472.    value of this string is a (UTF-8 encoded) dotted-decimal 
  473.    representation of an OBJECT IDENTIFIER.
  474.  
  475.         LDAPOID ::= OCTET STRING 
  476.  
  477.  
  478.  
  479. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 8
  480.  
  481. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  482.    
  483.    For example,
  484.  
  485.         1.3.6.1.4.1.1466.1.2.3
  486.  
  487. 4.1.3. Distinguished Name and Relative Distinguished Name
  488.  
  489.    An LDAPDN and a RelativeLDAPDN are respectively defined to be the
  490.    representation of a Distinguished Name and a Relative Distinguished
  491.    Name after encoding according to the specification in [4], such that
  492.  
  493.         <distinguished-name> ::= <name>
  494.  
  495.         <relative-distinguished-name> ::= <name-component>
  496.  
  497.    where <name> and <name-component> are as defined in [4]. 
  498.  
  499.         LDAPDN ::= LDAPString
  500.  
  501.         RelativeLDAPDN ::= LDAPString
  502.  
  503.    Only Attribute Types can be present in a relative distinguished name
  504.    component; the options of Attribute Descriptions (next section) 
  505.    MUST NOT be used in specifying distinguished names.
  506.  
  507. 4.1.4. Attribute Type
  508.  
  509.    An AttributeType takes on as its value the textual string associated 
  510.    with that AttributeType in its specification.  
  511.  
  512.         AttributeType ::= LDAPString
  513.  
  514.    Each attribute type has a unique OBJECT IDENTIFIER which has been 
  515.    assigned to it.  This identifier may be written as decimal digits
  516.    with components separated by periods, e.g. "2.5.4.10".  
  517.  
  518.    A specification may also assign one or more textual names for an
  519.    attribute type.  These names MUST begin with a letter, and only 
  520.    contain ASCII letters, digit characters and hyphens.  They are case 
  521.    insensitive.  (These ASCII characters are identical to ISO 10646 
  522.    characters whose UTF-8 encoding is a single byte between 0x00 and 
  523.    0x7F.)
  524.  
  525.    If the server has a textual name for an attribute type, it MUST use
  526.    a textual name for attributes returned in search results.  The dotted-
  527.    decimal OBJECT IDENTIFIER is only used if there is no textual name 
  528.    for an attribute type.
  529.  
  530.    Attribute type names are non-unique, as two different specifications
  531.    (neither in standards track RFCs) may choose the same name.  
  532.  
  533.  
  534.  
  535.  
  536.  
  537.  
  538.  
  539. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 9
  540.  
  541. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  542.  
  543.    A server which masters or shadows entries SHOULD list all the 
  544.    attribute types it supports in the subschema entries, using the 
  545.    attributeTypes attribute.  Servers which support an open-ended set of 
  546.    attributes SHOULD include at least the attributeTypes value for the 
  547.    'objectClass' attribute. Clients MAY retrieve the attributeTypes 
  548.    value from subschema entries in order to obtain the OBJECT IDENTIFIER 
  549.    and other information associated with attribute types.
  550.  
  551.    Some attribute type names which are used in this version of LDAP are 
  552.    described in [5].  Servers may implement additional attribute types.
  553.  
  554. 4.1.5. Attribute Description
  555.         
  556.    An AttributeDescription is a superset of the definition of the 
  557.    AttributeType.  It has the same ASN.1 definition, but allows 
  558.    additional options to be specified.  They are also case insensitive.
  559.  
  560.         AttributeDescription ::= LDAPString
  561.  
  562.    A value of AttributeDescription is based on the following BNF:
  563.         
  564.         <AttributeDescription> ::= <AttributeType> [ ";" <options> ]
  565.  
  566.         <options>  ::= <option> | <option> ";" <options>
  567.  
  568.         <option>   ::= <opt-char> <opt-char>*
  569.  
  570.         <opt-char> ::=  ASCII-equivalent letters, numbers and hyphen
  571.  
  572.    Examples of valid AttributeDescription:
  573.  
  574.         cn
  575.         userCertificate;binary
  576.  
  577.    One option, "binary", is defined in this document.  Additional options
  578.    may be defined in IETF standards-track and experimental RFCs.  Options
  579.    beginning with "x-" are reserved for private experiments.  Any option 
  580.    could be associated with any AttributeType, although not all 
  581.    combinations may be supported by a server.
  582.  
  583.    An AttributeDescription with one or more options is treated as a 
  584.    subtype of the attribute type without any options.  Options present 
  585.    in an AttributeDescription are never mutually exclusive.  
  586.    Implementations MUST generate the <options> list sorted in 
  587.    ascending order, and servers MUST treat any two AttributeDescription 
  588.    with the same AttributeType and options as equivalent.  A server will 
  589.    treat an AttributeDescription with any options it does not implement 
  590.    as an unrecognized attribute type. 
  591.  
  592.    The data type "AttributeDescriptionList" describes a list of 0 or 
  593.    more attribute types.  (A list of zero elements has special 
  594.    significance in the Search request.)
  595.  
  596.         AttributeDescriptionList ::= SEQUENCE OF 
  597.                 AttributeDescription
  598.  
  599. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 10
  600.  
  601. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  602.  
  603. 4.1.5.1. Binary Option
  604.  
  605.    If the "binary" option is present in an AttributeDescription, it 
  606.    overrides any string-based encoding representation defined for that 
  607.    attribute in [5]. Instead the attribute is to be transferred as a 
  608.    binary value encoded using the Basic Encoding Rules [11].  The syntax 
  609.    of the binary value is an ASN.1 data type definition which is 
  610.    referenced by the "SYNTAX" part of the attribute type definition.
  611.  
  612.    The presence or absence of the "binary" option only affects the 
  613.    transfer of attribute values in protocol; servers store any 
  614.    particular attribute in a single format.  If a client requests that a 
  615.    server return an attribute in the binary format, but the server 
  616.    cannot generate that format, the server MUST treat this attribute 
  617.    type as an unrecognized attribute type.  Similarly, clients MUST NOT 
  618.    expect servers to return an attribute in binary format if the client 
  619.    requested that attribute by name without the binary option.
  620.  
  621.    This option is intended to be used with attributes whose syntax is a 
  622.    complex ASN.1 data type, and the structure of values of that type is 
  623.    needed by clients.  Examples of this kind of syntax are "Certificate" 
  624.    and "CertificateList".
  625.  
  626. 4.1.6. Attribute Value
  627.  
  628.    A field of type AttributeValue takes on as its value either a string
  629.    encoding of a AttributeValue data type, or an OCTET STRING containing 
  630.    an encoded binary value, depending on whether the "binary" option is 
  631.    present in the companion AttributeDescription to this AttributeValue. 
  632.  
  633.    The definition of string encodings for different syntaxes and types 
  634.    may be found in other documents, and in particular [5].
  635.  
  636.         AttributeValue ::= OCTET STRING 
  637.  
  638.    Note that there is no defined limit on the size of this encoding; 
  639.    thus protocol values may include multi-megabyte attributes (e.g. 
  640.    photographs).
  641.  
  642.    Attributes may be defined which have arbitrary and non-printable 
  643.    syntax.  Implementations MUST NEITHER simply display nor attempt to 
  644.    decode as ASN.1 a value if its syntax is not known.  The 
  645.    implementation may attempt to discover the subschema of the source 
  646.    entry, and retrieve the values of attributeTypes from it.
  647.  
  648.    Clients MUST NOT send attribute values in a request which are not
  649.    valid according to the syntax defined for the attributes.  
  650.  
  651. 4.1.7. Attribute Value Assertion
  652.  
  653.    The AttributeValueAssertion type definition is similar to the one in
  654.    the X.500 directory standards.  It contains an attribute description 
  655.    and a matching rule assertion value suitable for that type. 
  656.  
  657.  
  658.  
  659. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 11
  660.  
  661. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  662.  
  663.         AttributeValueAssertion ::= SEQUENCE {
  664.                 attributeDesc   AttributeDescription,
  665.                 assertionValue  AssertionValue }
  666.  
  667.         AssertionValue ::= OCTET STRING
  668.  
  669.    If the "binary" option is present in attributeDesc, this signals to 
  670.    the server that the assertionValue is a binary encoding of the 
  671.    assertion value.  
  672.  
  673.    For all the string-valued user attributes described in [5], the 
  674.    assertion value syntax is the same as the value syntax.  Clients may 
  675.    use attribute values as assertion values in compare requests and 
  676.    search filters.
  677.  
  678.    Note however that the assertion syntax may be different from the value
  679.    syntax for other attributes or for non-equality matching rules.
  680.    These may have an assertion syntax which contains only part of the 
  681.    value.  See section 20.2.1.8 of X.501 [6] for examples.
  682.  
  683. 4.1.8. Attribute
  684.  
  685.    An attribute consists of a type and one or more values of that type.
  686.    (Though attributes MUST have at least one value when stored, due to 
  687.    access control restrictions the set may be empty when transferred  
  688.    in protocol.  This is described in section 4.5.2, concerning the 
  689.    PartialAttributeList type.)
  690.  
  691.         Attribute ::= SEQUENCE {
  692.                 type    AttributeDescription,
  693.                 vals    SET OF AttributeValue }
  694.  
  695.    Each attribute value is distinct in the set (no duplicates).  The 
  696.    order of attribute values within the vals set is undefined and 
  697.    implementation-dependent, and MUST NOT be relied upon.
  698.  
  699. 4.1.9. Matching Rule Identifier
  700.  
  701.    A matching rule is a means of expressing how a server should compare
  702.    an AssertionValue received in a search filter with an abstract data 
  703.    value.  The matching rule defines the syntax of the assertion value
  704.    and the process to be performed in the server.
  705.  
  706.    An X.501(1993) Matching Rule is identified in the LDAP protocol by the
  707.    printable representation of its OBJECT IDENTIFIER, either as one of 
  708.    the strings given in [5], or as decimal digits with components 
  709.    separated by periods, e.g. "caseIgnoreIA5Match" or 
  710.    "1.3.6.1.4.1.453.33.33".  
  711.  
  712.         MatchingRuleId ::= LDAPString
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 12
  720.  
  721. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  722.  
  723.    Servers which support matching rules for use in the extensibleMatch 
  724.    search filter MUST list the matching rules they implement in 
  725.    subschema entries, using the matchingRules attributes.  The server 
  726.    SHOULD also list there, using the matchingRuleUse attribute, the 
  727.    attribute types with which each matching rule can be used.  More 
  728.    information is given in section 4.4 of [5].
  729.  
  730. 4.1.10. Result Message
  731.  
  732.    The LDAPResult is the construct used in this protocol to return
  733.    success or failure indications from servers to clients. In response
  734.    to various requests servers will return responses containing fields
  735.    of type LDAPResult to indicate the final status of a protocol
  736.    operation request.  
  737.  
  738.         LDAPResult ::= SEQUENCE {
  739.                 resultCode      ENUMERATED {
  740.                              success                      (0),
  741.                              operationsError              (1),
  742.                              protocolError                (2),
  743.                              timeLimitExceeded            (3),
  744.                              sizeLimitExceeded            (4),
  745.                              compareFalse                 (5),
  746.                              compareTrue                  (6),
  747.  
  748.                              authMethodNotSupported       (7),
  749.                              strongAuthRequired           (8),
  750.                                         -- 9 reserved --
  751.                              referral                     (10),  -- new
  752.                              adminLimitExceeded           (11),  -- new
  753.                              unavailableCriticalExtension (12),  -- new
  754.                              confidentialityRequired      (13),  -- new
  755.                                         -- 14-15 unused --
  756.                              noSuchAttribute              (16),
  757.                              undefinedAttributeType       (17),
  758.                              inappropriateMatching        (18),
  759.                              constraintViolation          (19),
  760.                              attributeOrValueExists       (20),
  761.                              invalidAttributeSyntax       (21),
  762.                                         -- 22-31 unused --
  763.                              noSuchObject                 (32),
  764.                              aliasProblem                 (33),
  765.                              invalidDNSyntax              (34),
  766.                              -- 35 reserved for undefined isLeaf --
  767.                              aliasDereferencingProblem    (36),
  768.                                         -- 37-47 unused --
  769.                              inappropriateAuthentication  (48),
  770.                              invalidCredentials           (49),
  771.                              insufficientAccessRights     (50),
  772.                              busy                         (51),
  773.                              unavailable                  (52),
  774.                              unwillingToPerform           (53),
  775.                              loopDetect                   (54),
  776.                                         -- 55-63 unused --
  777.  
  778.  
  779. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 13
  780.  
  781. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  782.  
  783.                              namingViolation              (64),
  784.                              objectClassViolation         (65),
  785.                              notAllowedOnNonLeaf          (66),
  786.                              notAllowedOnRDN              (67),
  787.                              entryAlreadyExists           (68),
  788.                              objectClassModsProhibited    (69),
  789.                                         -- 70 reserved for CLDAP --
  790.                              affectsMultipleDSAs          (71), -- new
  791.                                         -- 72-79 unused --
  792.                              other                        (80) },
  793.                              -- 81-90 reserved for APIs --
  794.                 matchedDN       LDAPDN,
  795.                 errorMessage    LDAPString,
  796.                 referral        [3] Referral OPTIONAL }
  797.  
  798.    All the result codes with the exception of success, compareFalse and
  799.    compareTrue are to be treated as meaning the operation could not be 
  800.    completed in its entirety.  
  801.  
  802.    Most of the result codes are based on problem indications from X.511
  803.    error data types.  Result codes from 16 to 21 indicate an 
  804.    AttributeProblem, codes 32, 33, 34 and 36 indicate a NameProblem, 
  805.    codes 48, 49 and 50 indicate a SecurityProblem, codes 51 to 54 
  806.    indicate a ServiceProblem, and codes 64 to 69 and 71 indicates an 
  807.    UpdateProblem.
  808.  
  809.    If a client receives a result code which is not listed above, it is 
  810.    to be treated as an unknown error condition.
  811.  
  812.    The errorMessage field of this construct may, at the server's option, 
  813.    be used to return a string containing a textual, human-readable 
  814.    (terminal control and page formatting characters should be avoided) 
  815.    error diagnostic. As this error diagnostic is not standardized, 
  816.    implementations MUST NOT rely on the values returned.  If the server 
  817.    chooses not to return a textual diagnostic, the errorMessage field of 
  818.    the LDAPResult type MUST contain a zero length string.
  819.  
  820.    For result codes of noSuchObject, aliasProblem, invalidDNSyntax
  821.    and aliasDereferencingProblem, the matchedDN field is set to
  822.    the name of the lowest entry (object or alias) in the directory that 
  823.    was matched.  If no aliases were dereferenced while attempting to 
  824.    locate the entry, this will be a truncated form of the name provided, 
  825.    or if aliases were dereferenced, of the resulting name, as defined in 
  826.    section 12.5 of X.511 [15]. The matchedDN field is to be set to a 
  827.    zero length string with all other result codes.
  828.  
  829. 4.1.11. Referral
  830.  
  831.    The referral field is present in an LDAPResult if the 
  832.    LDAPResult.resultCode field value is referral, and absent with all 
  833.    other result codes.  It contains a reference to another server (or 
  834.    set of servers) which may be accessed via LDAP or other protocols.  
  835.    Referrals can be returned in responses to any operation request 
  836.    (except unbind and abandon which do not have responses). At least one 
  837.    LDAPURL MUST be present in the reference.
  838.  
  839. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 14
  840.  
  841. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  842.  
  843.         Referral ::= SEQUENCE OF LDAPURL
  844.  
  845.         LDAPURL ::= LDAPString -- limited to characters permitted in URLs
  846.    
  847.    The client MUST contact one of the listed URLs [7] of servers to 
  848.    continue the request. Each server in the list MUST be capable of 
  849.    processing the operation and presenting a consistent view of the 
  850.    directory to the client, so the client may choose any URL in the 
  851.    list. (The mechanisms for how servers achieve this are outside the 
  852.    scope of this document.)
  853.  
  854.    URLs for servers implementing the LDAP protocol are written according 
  855.    to [9].  If an alias was dereferenced, the <dn> part of the URL MUST
  856.    be present, with the new target object name.  If this is present, 
  857.    the client MUST use this name in its next request to progress the 
  858.    operation, and if it is not present the client will use the same name 
  859.    as in the original request.  Some servers (e.g. participating in 
  860.    distributed indexing) may provide a different filter in a referral 
  861.    for a search operation.  If the filter part of the URL is present in 
  862.    an LDAPURL, the client MUST use this filter in its next request to 
  863.    progress this search, and if it is not present the client MUST use 
  864.    the same filter as it used for that search.
  865.  
  866.    Note that UTF-8 characters appearing in a DN or search filter may not
  867.    be legal for URLs (e.g. spaces) and MUST be escaped using the % method
  868.    in RFC 1738 [7].
  869.  
  870.    Other kinds of URLs may be returned, so long as the operation could be
  871.    performed using that protocol. 
  872.  
  873. 4.1.12. Controls
  874.  
  875.    A control is a way to specify extension information. Controls which 
  876.    are sent as part of a request apply only to that request and are not 
  877.    saved.
  878.  
  879.         Controls ::= SEQUENCE OF Control
  880.  
  881.         Control ::= SEQUENCE {
  882.                 controlType             LDAPOID,
  883.                 criticality             BOOLEAN DEFAULT FALSE,
  884.                 controlValue            OCTET STRING OPTIONAL }
  885.  
  886.    The controlType field MUST be a UTF-8 encoded dotted-decimal 
  887.    representation of an OBJECT IDENTIFIER which uniquely identifies the 
  888.    control.  This prevents conflicts between control names.
  889.  
  890.    The criticality field is either TRUE or FALSE.  
  891.  
  892.    If the server recognizes the control type and it is appropriate for 
  893.    the operation, the server will make use of the control when 
  894.    performing the operation.
  895.  
  896.  
  897.  
  898.  
  899. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 15
  900.  
  901. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  902.  
  903.    If the server does not recognize the control type and the criticality 
  904.    field is TRUE, the server MUST NOT perform the operation, and MUST 
  905.    instead return the resultCode unsupportedCriticalExtension.
  906.  
  907.    If the control is not appropriate for the operation and criticality 
  908.    field is TRUE, the server MUST NOT perform the operation, and MUST 
  909.    instead return the resultCode unsupportedCriticalExtension.
  910.  
  911.    If the control is unrecognized or inappropriate but the criticality 
  912.    field is FALSE, the server MUST ignore the control.
  913.  
  914.    The controlValue contains any information associated with the control,
  915.    and its format is defined for the control.  The server MUST be 
  916.    prepared to handle arbitrary contents of the controlValue octet 
  917.    string, including zero bytes.  It is absent only if there is no value 
  918.    information which is associated with a control of its type.
  919.  
  920.    This document does not define any controls.  Controls may be defined 
  921.    in other documents.  The definition of a control consists of:
  922.  
  923.      - the OBJECT IDENTIFIER assigned to the control,
  924.  
  925.      - whether the control is always noncritical, always critical, or 
  926.        critical at the client's option,
  927.  
  928.      - the format of the controlValue contents of the control.
  929.  
  930.    Servers list the controls which they recognize in the supportedControl
  931.    attribute in the root DSE.
  932.  
  933. 4.2. Bind Operation
  934.  
  935.    The function of the Bind Operation is to allow authentication 
  936.    information to be exchanged between the client and server.
  937.  
  938.    The Bind Request is defined as follows:
  939.  
  940.         BindRequest ::= [APPLICATION 0] SEQUENCE {
  941.                 version                 INTEGER (1 .. 127),
  942.                 name                    LDAPDN,
  943.                 authentication          AuthenticationChoice }
  944.  
  945.         AuthenticationChoice ::= CHOICE {
  946.                 simple                  [0] OCTET STRING,
  947.                                          -- 1 and 2 reserved
  948.                 sasl                    [3] SaslCredentials }
  949.  
  950.         SaslCredentials ::= SEQUENCE {
  951.                 mechanism               LDAPString,
  952.                 credentials             OCTET STRING OPTIONAL }
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 16
  960.  
  961. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  962.  
  963.    Parameters of the Bind Request are:
  964.  
  965.    - version: A version number indicating the version of the protocol to
  966.      be used in this protocol session.  This document describes version
  967.      3 of the LDAP protocol.  Note that there is no version negotiation,
  968.      and the client just sets this parameter to the version it desires.
  969.      If the client requests protocol version 2, a server that supports
  970.      the version 2 protocol as described in [2] will not return any
  971.      v3-specific protocol fields.  (Note that not all LDAP servers will
  972.      support protocol version 2, since they may be unable to generate 
  973.      the attribute syntaxes associated with version 2.)
  974.  
  975.    - name: The name of the directory object that the client wishes to
  976.      bind as.  This field may take on a null value (a zero length
  977.      string) for the purposes of anonymous binds, when authentication
  978.      has been performed at a lower layer, or when using SASL credentials
  979.      with a mechanism that includes the LDAPDN in the credentials. 
  980.  
  981.    - authentication: information used to authenticate the name, if any,
  982.      provided in the Bind Request.  
  983.  
  984.    Upon receipt of a Bind Request, a protocol server will authenticate
  985.    the requesting client, if necessary.  The server will then return a 
  986.    Bind Response to the client indicating the status of the 
  987.    authentication.
  988.  
  989.    Authorization is the use of this authentication information when 
  990.    performing operations.  Authorization MAY be affected by factors 
  991.    outside of the LDAP Bind request, such as lower layer security 
  992.    services.
  993.  
  994. 4.2.1. Sequencing of the Bind Request
  995.  
  996.    For some SASL authentication mechanisms, it may be necessary for the 
  997.    client to invoke the BindRequest multiple times.  If at any stage the 
  998.    client wishes to abort the bind process it MAY unbind and then drop 
  999.    the underlying connection.  Clients MUST NOT invoke operations 
  1000.    between two Bind requests made as part of a multi-stage bind.  
  1001.  
  1002.    A client may abort a SASL bind negotiation by sending a BindRequest
  1003.    with a different value in the mechanism field of SaslCredentials,
  1004.    or an AuthenticationChoice other than sasl.
  1005.  
  1006.    If the client sends a BindRequest with the sasl mechanism field as 
  1007.    an empty string, the server MUST return a BindResponse with 
  1008.    authMethodNotSupported as the resultCode.  This will allow clients 
  1009.    to abort a negotiation if it wishes to try again with the same SASL
  1010.    mechanism.
  1011.  
  1012.    Unlike LDAP v2, the client need not send a Bind Request in the first
  1013.    PDU of the connection.  The client may request any operations and the
  1014.    server MUST treat these as unauthenticated. If the server requires 
  1015.    that the client bind before browsing or modifying the directory, the 
  1016.    server MAY reject a request other than binding, unbinding or an 
  1017.    extended request with the "operationsError" result. 
  1018.  
  1019. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 17
  1020.  
  1021. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1022.  
  1023.    If the client did not bind before sending a request and receives an 
  1024.    operationsError, it may then send a Bind Request.  If this also fails
  1025.    or the client chooses not to bind on the existing connection, it will
  1026.    close the connection, reopen it and begin again by first sending a PDU
  1027.    with a Bind Request.  This will aid in interoperating with servers 
  1028.    implementing other versions of LDAP.
  1029.  
  1030.    Clients MAY send multiple bind requests on a connection to change
  1031.    their credentials.  A subsequent bind process has the effect of 
  1032.    abandoning all operations outstanding on the connection.  (This 
  1033.    simplifies server implementation.)  Authentication from earlier binds 
  1034.    are subsequently ignored, and so if the bind fails, the connection 
  1035.    will be treated as anonymous. If a SASL transfer encryption or 
  1036.    integrity mechanism has been negotiated, and that mechanism does not 
  1037.    support the changing of credentials from one identity to another, 
  1038.    then the client MUST instead establish a new connection. 
  1039.  
  1040. 4.2.2. Authentication and Other Security Services
  1041.  
  1042.    The simple authentication option provides minimal authentication 
  1043.    facilities, with the contents of the authentication field consisting 
  1044.    only of a cleartext password.  Note that the use of cleartext 
  1045.    passwords is not recommended over open networks when there is no 
  1046.    authentication or encryption being performed by a lower layer; see 
  1047.    the "Security Considerations" section.
  1048.  
  1049.    If no authentication is to be performed, then the simple 
  1050.    authentication option MUST be chosen, and the password be of zero 
  1051.    length.  (This is often done by LDAPv2 clients.)  Typically the 
  1052.    DN is also of zero length.
  1053.  
  1054.    The sasl choice allows for any mechanism defined for use with SASL 
  1055.    [12].  The mechanism field contains the name of the mechanism.  The 
  1056.    credentials field contains the arbitrary data used for authentication,
  1057.    inside an OCTET STRING wrapper.  Note that unlike some Internet 
  1058.    application protocols where SASL is used, LDAP is not text-based, 
  1059.    thus no base64 transformations are performed on the credentials.
  1060.  
  1061.    If any SASL-based integrity or confidentiality services are enabled, 
  1062.    they take effect following the transmission by the server and 
  1063.    reception by the client of the final BindResponse with resultCode 
  1064.    success.
  1065.  
  1066.    The client can request that the server use authentication information
  1067.    from a lower layer protocol, such as TLS [8], by using the SASL
  1068.    EXTERNAL mechanism.
  1069.  
  1070. 4.2.3. Bind Response
  1071.  
  1072.    The Bind Response is defined as follows.
  1073.  
  1074.         BindResponse ::= [APPLICATION 1] SEQUENCE {
  1075.              COMPONENTS OF LDAPResult,
  1076.              serverSaslCreds    [7] OCTET STRING OPTIONAL }
  1077.  
  1078.  
  1079. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 18
  1080.  
  1081. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1082.  
  1083.    A BindResponse consists simply of an indication from the server of
  1084.    the status of the client's request for authentication.
  1085.  
  1086.    If the bind was successful, the resultCode will be success,
  1087.    otherwise it will be one of:
  1088.  
  1089.     - operationsError: server encountered an internal error,
  1090.  
  1091.     - protocolError: unrecognized version number or incorrect PDU 
  1092.       structure,
  1093.  
  1094.     - authMethodNotSupported: unrecognized SASL mechanism name,
  1095.  
  1096.     - strongAuthRequired: the server requires authentication be 
  1097.       performed with a SASL mechanism,
  1098.  
  1099.     - referral: this server cannot accept this bind and the client 
  1100.       should try another,
  1101.  
  1102.     - inappropriateAuthentication: the server requires the client 
  1103.       which had attempted to bind anonymously or without supplying
  1104.       credentials to provide some form of credentials,
  1105.  
  1106.     - invalidCredentials: the wrong password was supplied or the SASL
  1107.       credentials could not be processed,
  1108.  
  1109.     - unavailable: the server is shutting down.
  1110.   
  1111.    If the server does not support the client's requested protocol 
  1112.    version, it MUST set the resultCode to protocolError.
  1113.  
  1114.    If the client receives a BindResponse response where the resultCode 
  1115.    was protocolError, it MUST close the connection as the server will be 
  1116.    unwilling to accept further operations.  (This is for compatibility 
  1117.    with earlier versions of LDAP, in which the bind was always the first 
  1118.    operation, and there was no negotiation.)
  1119.  
  1120.    The serverSaslCreds are used as part of a SASL-defined bind mechanism 
  1121.    to allow the client to authenticate the server to which it is 
  1122.    communicating, or to perform "challenge-response" authentication.  
  1123.    If the client bound with the password choice, or the SASL mechanism 
  1124.    does not require the server to return information to the client, then 
  1125.    this field is not to be included in the result.
  1126.  
  1127. 4.3. Unbind Operation
  1128.  
  1129.    The function of the Unbind Operation is to terminate a protocol
  1130.    session.  The Unbind Operation is defined as follows:
  1131.  
  1132.         UnbindRequest ::= [APPLICATION 2] NULL
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 19
  1140.  
  1141. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1142.  
  1143.    The Unbind Operation has no response defined. Upon transmission of an
  1144.    UnbindRequest, a protocol client may assume that the protocol session
  1145.    is terminated. Upon receipt of an UnbindRequest, a protocol server
  1146.    may assume that the requesting client has terminated the session and
  1147.    that all outstanding requests may be discarded, and may close the 
  1148.    connection.
  1149.  
  1150. 4.4. Unsolicited Notification
  1151.  
  1152.    An unsolicited notification is an LDAPMessage sent from the server to 
  1153.    the client which is not in response to any LDAPMessage received by 
  1154.    the server. It is used to signal an extraordinary condition in the 
  1155.    server or in the connection between the client and the server.  The 
  1156.    notification is of an advisory nature, and the server will not expect 
  1157.    any response to be returned from the client.
  1158.  
  1159.    The unsolicited notification is structured as an LDAPMessage in which 
  1160.    the messageID is 0 and protocolOp is of the extendedResp form.  The 
  1161.    responseName field of the ExtendedResponse is present. The LDAPOID 
  1162.    value MUST be unique for this notification, and not be used in any 
  1163.    other situation.
  1164.  
  1165.  
  1166.    One unsolicited notification is defined in this document.  
  1167.  
  1168. 4.4.1. Notice of Disconnection
  1169.  
  1170.    This notification may be used by the server to advise the client that 
  1171.    the server is about to close the connection due to an error condition.
  1172.    Note that this notification is NOT a response to an unbind requested 
  1173.    by the client: the server MUST follow the procedures of section 4.3. 
  1174.    This notification is intended to assist clients in distinguishing 
  1175.    between an error condition and a transient network failure.  As with 
  1176.    a connection close due to network failure, the client MUST NOT assume 
  1177.    that any outstanding requests which modified the directory have 
  1178.    succeeded or failed. 
  1179.  
  1180.    The responseName is 1.3.6.1.4.1.1466.20036, the response field is 
  1181.    absent, and the resultCode is used to indicate the reason for the 
  1182.    disconnection.
  1183.  
  1184.    The following resultCode values are to be used in this notification:
  1185.  
  1186.    - protocolError: The server has received data from the client in which
  1187.      the LDAPMessage structure could not be parsed.  
  1188.  
  1189.    - strongAuthRequired: The server has detected that an established
  1190.      underlying security association protecting communication between the
  1191.      client and server has unexpectedly failed or been compromised.
  1192.  
  1193.    - unavailable: This server will stop accepting new connections and
  1194.      operations on all existing connections, and be unavailable for an 
  1195.      extended period of time.  The client may make use of an alternative 
  1196.      server.
  1197.  
  1198.  
  1199. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 20
  1200.  
  1201. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1202.  
  1203.    After sending this notice, the server MUST close the connection.  
  1204.    After receiving this notice, the client MUST NOT transmit any further
  1205.    on the connection, and may abruptly close the connection.
  1206.  
  1207. 4.5. Search Operation
  1208.  
  1209.    The Search Operation allows a client to request that a search be
  1210.    performed on its behalf by a server.  This can be used to read 
  1211.    attributes from a single entry, from entries immediately below a 
  1212.    particular entry, or a whole subtree of entries.
  1213.  
  1214. 4.5.1. Search Request
  1215.  
  1216.    The Search Request is defined as follows:
  1217.  
  1218.         SearchRequest ::= [APPLICATION 3] SEQUENCE {
  1219.                 baseObject      LDAPDN,
  1220.                 scope           ENUMERATED {
  1221.                         baseObject              (0),
  1222.                         singleLevel             (1),
  1223.                         wholeSubtree            (2) },
  1224.                 derefAliases    ENUMERATED {
  1225.                         neverDerefAliases       (0),
  1226.                         derefInSearching        (1),
  1227.                         derefFindingBaseObj     (2),
  1228.                         derefAlways             (3) },
  1229.                 sizeLimit       INTEGER (0 .. maxInt),
  1230.                 timeLimit       INTEGER (0 .. maxInt),
  1231.                 typesOnly       BOOLEAN,
  1232.                 filter          Filter,
  1233.                 attributes      AttributeDescriptionList }
  1234.  
  1235.         Filter ::= CHOICE {
  1236.                 and             [0] SET OF Filter,
  1237.                 or              [1] SET OF Filter,
  1238.                 not             [2] Filter,
  1239.                 equalityMatch   [3] AttributeValueAssertion,
  1240.                 substrings      [4] SubstringFilter,
  1241.                 greaterOrEqual  [5] AttributeValueAssertion,
  1242.                 lessOrEqual     [6] AttributeValueAssertion,
  1243.                 present         [7] AttributeDescription,
  1244.                 approxMatch     [8] AttributeValueAssertion,
  1245.                 extensibleMatch [9] MatchingRuleAssertion }     
  1246.  
  1247.         SubstringFilter ::= SEQUENCE {
  1248.                 type            AttributeDescription,
  1249.                 -- at least one must be present
  1250.                 substrings      SEQUENCE OF CHOICE { 
  1251.                         initial [0] LDAPString,
  1252.                         any     [1] LDAPString,
  1253.                         final   [2] LDAPString } }
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 21
  1260.  
  1261. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1262.  
  1263.         MatchingRuleAssertion ::= SEQUENCE {
  1264.                 matchingRule    [1] MatchingRuleId OPTIONAL,
  1265.                 type            [2] AttributeDescription OPTIONAL,
  1266.                 matchValue      [3] AssertionValue,
  1267.                 dnAttributes    [4] BOOLEAN DEFAULT FALSE }
  1268.  
  1269.    Parameters of the Search Request are:
  1270.  
  1271.    - baseObject: An LDAPDN that is the base object entry relative to
  1272.      which the search is to be performed.
  1273.  
  1274.    - scope: An indicator of the scope of the search to be performed. The
  1275.      semantics of the possible values of this field are identical to the
  1276.      semantics of the scope field in the X.511 Search Operation.
  1277.  
  1278.    - derefAliases: An indicator as to how alias objects (as defined in 
  1279.      X.501) are to be handled in searching.  The semantics of the 
  1280.      possible values of this field are:
  1281.  
  1282.              neverDerefAliases: do not dereference aliases in searching
  1283.              or in locating the base object of the search;
  1284.  
  1285.              derefInSearching: dereference aliases in subordinates of
  1286.              the base object in searching, but not in locating the
  1287.              base object of the search;
  1288.  
  1289.              derefFindingBaseObj: dereference aliases in locating
  1290.              the base object of the search, but not when searching
  1291.              subordinates of the base object;
  1292.  
  1293.              derefAlways: dereference aliases both in searching and in
  1294.              locating the base object of the search.
  1295.  
  1296.    - sizelimit: A sizelimit that restricts the maximum number of entries
  1297.      to be returned as a result of the search. A value of 0 in this
  1298.      field indicates that no client-requested sizelimit restrictions are 
  1299.      in effect for the search.  Servers may enforce a maximum number of
  1300.      entries to return.
  1301.  
  1302.    - timelimit: A timelimit that restricts the maximum time (in seconds)
  1303.      allowed for a search. A value of 0 in this field indicates that no
  1304.      client-requested timelimit restrictions are in effect for the 
  1305.      search.
  1306.  
  1307.    - typesOnly: An indicator as to whether search results will contain
  1308.      both attribute types and values, or just attribute types.  Setting
  1309.      this field to TRUE causes only attribute types (no values) to be
  1310.      returned.  Setting this field to FALSE causes both attribute types
  1311.      and values to be returned.
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 22
  1320.  
  1321. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1322.  
  1323.    - filter: A filter that defines the conditions that must be fulfilled
  1324.      in order for the search to match a given entry.  
  1325.  
  1326.      The 'and', 'or' and 'not' choices can be used to form combinations of
  1327.      filters. At least one filter element MUST be present in an 'and' or 
  1328.      'or' choice.  The others match against individual attribute values of
  1329.      entries in the scope of the search.  (Implementor's note: the 'not' 
  1330.      filter is an example of a tagged choice in an implicitly-tagged 
  1331.      module.  In BER this is treated as if the tag was explicit.)
  1332.  
  1333.      A server MUST evaluate filters according to the three-valued logic
  1334.      of X.511(93) section 7.8.1.  In summary, a filter is evaluated to 
  1335.      either "TRUE", "FALSE" or "Undefined".  If the filter evaluates 
  1336.      to TRUE for a particular entry, then the attributes of that entry 
  1337.      are returned as part of the search result (subject to any applicable
  1338.      access control restrictions). If the filter evaluates to FALSE or 
  1339.      Undefined, then the entry is ignored for the search.
  1340.  
  1341.      A filter of the "and" choice is TRUE if all the filters in the SET 
  1342.      OF evaluate to TRUE, FALSE if at least one filter is FALSE, and 
  1343.      otherwise Undefined.  A filter of the "or" choice is FALSE if all 
  1344.      of the filters in the SET OF evaluate to FALSE, TRUE if at least 
  1345.      one filter is TRUE, and Undefined otherwise.  A filter of the "not" 
  1346.      choice is TRUE if the filter being negated is FALSE, FALSE if it is 
  1347.      TRUE, and Undefined if it is Undefined.
  1348.  
  1349.      The present match evaluates to TRUE where there is an attribute or
  1350.      subtype of the specified attribute description present in an entry, 
  1351.      and FALSE otherwise (including a presence test with an unrecognized 
  1352.      attribute description.)
  1353.  
  1354.      The extensibleMatch is new in this version of LDAP.  If the 
  1355.      matchingRule field is absent, the type field MUST be present, and
  1356.      the equality match is performed for that type.  If the type field is
  1357.      absent and matchingRule is present, the matchValue is compared 
  1358.      against all attributes in an entry which support that matchingRule,
  1359.      and the matchingRule determines the syntax for the assertion value
  1360.      (the filter item evaluates to TRUE if it matches with at least 
  1361.      one attribute in the entry, FALSE if it does not match any attribute
  1362.      in the entry, and Undefined if the matchingRule is not recognized
  1363.      or the assertionValue cannot be parsed.)  If the type field is 
  1364.      present and matchingRule is present, the matchingRule MUST be one 
  1365.      permitted for use with that type, otherwise the filter item is 
  1366.      undefined.  If the dnAttributes field is set to TRUE, the match is 
  1367.      applied against all the attributes in an entry's distinguished name 
  1368.      as well, and also evaluates to TRUE if there is at least one 
  1369.      attribute in the distinguished name for which the filter item 
  1370.      evaluates to TRUE.  (Editors note: The dnAttributes field is present
  1371.      so that there does not need to be multiple versions of generic 
  1372.      matching rules such as for word matching, one to apply to entries 
  1373.      and another to apply to entries and dn attributes as well).
  1374.  
  1375.  
  1376.  
  1377. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 23
  1378.  
  1379. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1380.  
  1381.      A filter item evaluates to Undefined when the server would not
  1382.      be able to determine whether the assertion value matches an
  1383.      entry.  If an attribute description in an equalityMatch, substrings,
  1384.      greaterOrEqual, lessOrEqual, approxMatch or extensibleMatch 
  1385.      filter is not recognized by the server, a matching rule id in the 
  1386.      extensibleMatch is not recognized by the server, the assertion
  1387.      value cannot be parsed, or the type of filtering requested is not 
  1388.      implemented, then the filter is Undefined.  Thus for example if a 
  1389.      server did not recognize the attribute type shoeSize, a filter of 
  1390.      (shoeSize=*) would evaluate to FALSE, and the filters (shoeSize=12), 
  1391.      (shoeSize>=12) and (shoeSize<=12) would evaluate to Undefined.
  1392.      
  1393.      Servers MUST NOT return errors if attribute descriptions or matching 
  1394.      rule ids are not recognized, or assertion values cannot be parsed.  
  1395.      More details of filter processing are given in section 7.8 of X.511 
  1396.      [15].
  1397.  
  1398.    - attributes: A list of the attributes to be returned from each entry 
  1399.      which matches the search filter. There are two special values which
  1400.      may be used: an empty list with no attributes, and the attribute 
  1401.      description string "*".  Both of these signify that all user  
  1402.      attributes are to be returned.  (The "*" allows the client to 
  1403.      request all user attributes in addition to specific operational 
  1404.      attributes).
  1405.  
  1406.      Attributes MUST be named at most once in the list, and are returned 
  1407.      at most once in an entry.   If there are attribute descriptions in 
  1408.      the list which are not recognized, they are ignored by the server.
  1409.  
  1410.      If the client does not want any attributes returned, it can specify 
  1411.      a list containing only the attribute with OID "1.1".  This OID was 
  1412.      chosen arbitrarily and does not correspond to any attribute in use.
  1413.  
  1414.      Client implementors should note that even if all user attributes are
  1415.      requested, some attributes of the entry may not be included in 
  1416.      search results due to access control or other restrictions.  
  1417.      Furthermore, servers will not return operational attributes, such 
  1418.      as objectClasses or attributeTypes, unless they are listed by name, 
  1419.      since there may be extremely large number of values for certain 
  1420.      operational attributes. (A list of operational attributes for use 
  1421.      in LDAP is given in [5].)
  1422.  
  1423.    Note that an X.500 "list"-like operation can be emulated by the client
  1424.    requesting a one-level LDAP search operation with a filter checking 
  1425.    for the existence of the objectClass attribute, and that an X.500 
  1426.    "read"-like operation can be emulated by a base object LDAP search 
  1427.    operation with the same filter.  A server which provides a gateway to 
  1428.    X.500 is not required to use the Read or List operations, although it 
  1429.    may choose to do so, and if it does must provide the same semantics
  1430.    as the X.500 search operation. 
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 24
  1438.  
  1439. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1440.  
  1441. 4.5.2. Search Result
  1442.  
  1443.    The results of the search attempted by the server upon receipt of a
  1444.    Search Request are returned in Search Responses, which are LDAP 
  1445.    messages containing either SearchResultEntry, SearchResultReference,
  1446.    ExtendedResponse or SearchResultDone data types. 
  1447.  
  1448.         SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
  1449.                 objectName      LDAPDN,
  1450.                 attributes      PartialAttributeList }
  1451.  
  1452.         PartialAttributeList ::= SEQUENCE OF SEQUENCE { 
  1453.                 type    AttributeDescription,
  1454.                 vals    SET OF AttributeValue } 
  1455.         -- implementors should note that the PartialAttributeList may 
  1456.         -- have zero elements (if none of the attributes of that entry 
  1457.         -- were requested, or could be returned), and that the vals set 
  1458.         -- may also have zero elements (if types only was requested, or 
  1459.         -- all values were excluded from the result.)
  1460.  
  1461.         SearchResultReference ::= [APPLICATION 19] SEQUENCE OF LDAPURL
  1462.         -- at least one LDAPURL element must be present
  1463.                
  1464.         SearchResultDone ::= [APPLICATION 5] LDAPResult
  1465.  
  1466.    Upon receipt of a Search Request, a server will perform the necessary
  1467.    search of the DIT.
  1468.  
  1469.    If the LDAP session is operating over a connection-oriented transport
  1470.    such as TCP, the server will return to the client a sequence of 
  1471.    responses in separate LDAP messages.  There may be zero or more 
  1472.    responses containing SearchResultEntry, one for each entry found 
  1473.    during the search.  There may also be zero or more responses 
  1474.    containing SearchResultReference, one for each area not explored by 
  1475.    this server during the search.  The SearchResultEntry and 
  1476.    SearchResultReference PDUs may come in any order. Following all the 
  1477.    SearchResultReference responses and all SearchResultEntry responses 
  1478.    to be returned by the server, the server will return a response 
  1479.    containing the SearchResultDone, which contains an indication of 
  1480.    success, or detailing any errors that have occurred.  
  1481.  
  1482.    Each entry returned in a SearchResultEntry will contain all 
  1483.    attributes, complete with associated values if necessary, as 
  1484.    specified in the attributes field of the Search Request.  Return of 
  1485.    attributes is subject to access control and other administrative 
  1486.    policy.  Some attributes may be returned in binary format (indicated 
  1487.    by the AttributeDescription in the response having the binary option 
  1488.    present).
  1489.  
  1490.    Some attributes may be constructed by the server and appear in a 
  1491.    SearchResultEntry attribute list, although they are not stored 
  1492.    attributes of an entry. Clients MUST NOT assume that all attributes 
  1493.    can be modified, even if permitted by access control.
  1494.  
  1495.  
  1496.  
  1497. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 25
  1498.  
  1499. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1500.  
  1501.    LDAPMessage responses of the ExtendedResponse form are reserved for 
  1502.    returning information associated with a control requested by the 
  1503.    client.  These may be defined in future versions of this document.
  1504.  
  1505. 4.5.3. Continuation References in the Search Result
  1506.  
  1507.    If the server was able to locate the entry referred to by the 
  1508.    baseObject but was unable to search all the entries in the scope at 
  1509.    and under the baseObject, the server may return one or more 
  1510.    SearchResultReference, each containing a reference to another set of 
  1511.    servers for continuing the operation. A server MUST NOT return any  
  1512.    SearchResultReference if it has not located the baseObject and 
  1513.    thus has not searched any entries; in this case it would return a 
  1514.    SearchResultDone containing a referral resultCode.
  1515.  
  1516.    In the absence of indexing information provided to a server from 
  1517.    servers holding subordinate naming contexts, SearchResultReference 
  1518.    responses are not affected by search filters and are always returned 
  1519.    when in scope.
  1520.  
  1521.    The SearchResultReference is of the same data type as the Referral.
  1522.    URLs for servers implementing the LDAP protocol are written according 
  1523.    to [9].  The <dn> part MUST be present in the URL, with the new target
  1524.    object name.  The client MUST use this name in its next request.
  1525.    Some servers (e.g. part of a distributed index exchange system) may 
  1526.    provide a different filter in the URLs of the SearchResultReference.  
  1527.    If the filter part of the URL is present in an LDAP URL, the client 
  1528.    MUST use the new filter in its next request to progress the search, 
  1529.    and if the filter part is absent the client will use again the filter 
  1530.    from the original search.
  1531.  
  1532.    Other kinds of URLs may be returned so long as the operation could be 
  1533.    performed using that protocol.
  1534.  
  1535.    The name of an unexplored subtree in a SearchResultReference need not 
  1536.    be subordinate to the base object.
  1537.  
  1538.    In order to complete the search, the client MUST issue a new search 
  1539.    operation for each SearchResultReference that is returned.  Note that 
  1540.    the abandon operation described in section 4.11 applies only to a 
  1541.    particular operation sent on a connection between a client and server,
  1542.    and if the client has multiple outstanding search operations to 
  1543.    different servers, it MUST abandon each operation individually.
  1544.  
  1545. 4.5.3.1. Example
  1546.  
  1547.    For example, suppose the contacted server (hosta) holds the entry 
  1548.    "O=MNN,C=WW" and the entry "CN=Manager,O=MNN,C=WW".  It knows that 
  1549.    either LDAP-capable servers (hostb) or (hostc) hold 
  1550.    "OU=People,O=MNN,C=WW" (one is the master and the other server a 
  1551.    shadow), and that LDAP-capable server (hostd) holds the subtree 
  1552.    "OU=Roles,O=MNN,C=WW".  If a subtree search of "O=MNN,C=WW" is 
  1553.    requested to the contacted server, it may return the following:
  1554.  
  1555. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 26
  1556.  
  1557. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1558.  
  1559.      SearchResultEntry for O=MNN,C=WW
  1560.      SearchResultEntry for CN=Manager,O=MNN,C=WW
  1561.      SearchResultReference {
  1562.        ldap://hostb/OU=People,O=MNN,C=WW
  1563.        ldap://hostc/OU=People,O=MNN,C=WW
  1564.      }
  1565.      SearchResultReference {
  1566.        ldap://hostd/OU=Roles,O=MNN,C=WW
  1567.      }
  1568.      SearchResultDone (success)
  1569.  
  1570.    Client implementors should note that when following a 
  1571.    SearchResultReference, additional SearchResultReference may be 
  1572.    generated.  Continuing the example, if the client contacted the 
  1573.    server (hostb) and issued the search for the subtree 
  1574.    "OU=People,O=MNN,C=WW", the server might respond as follows:
  1575.   
  1576.      SearchResultEntry for OU=People,O=MNN,C=WW
  1577.      SearchResultReference {
  1578.       ldap://hoste/OU=Managers,OU=People,O=MNN,C=WW
  1579.      }
  1580.      SearchResultReference {
  1581.       ldap://hostf/OU=Consultants,OU=People,O=MNN,C=WW
  1582.      }
  1583.      SearchResultDone (success)
  1584.  
  1585.    If the contacted server does not hold the base object for the search, 
  1586.    then it will return a referral to the client.  For example, if the
  1587.    client requests a subtree search of "O=XYZ,C=US" to hosta, the server
  1588.    may return only a SearchResultDone containing a referral. 
  1589.  
  1590.      SearchResultDone (referral) {
  1591.        ldap://hostg/O=XYZ,C=US
  1592.      }
  1593.  
  1594. 4.6. Modify Operation
  1595.  
  1596.    The Modify Operation allows a client to request that a modification
  1597.    of an entry be performed on its behalf by a server.  The Modify
  1598.    Request is defined as follows:
  1599.  
  1600.         ModifyRequest ::= [APPLICATION 6] SEQUENCE {
  1601.                 object          LDAPDN,
  1602.                 modification    SEQUENCE OF SEQUENCE {
  1603.                         operation       ENUMERATED {
  1604.                                                 add     (0),
  1605.                                                 delete  (1),
  1606.                                                 replace (2) },
  1607.                         modification    AttributeTypeAndValues } }
  1608.  
  1609.         AttributeTypeAndValues ::= SEQUENCE {
  1610.                 type    AttributeDescription,
  1611.                 vals    SET OF AttributeValue }
  1612.  
  1613.  
  1614.  
  1615. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 27
  1616.  
  1617. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1618.  
  1619.    Parameters of the Modify Request are:
  1620.  
  1621.    - object: The object to be modified. The value of this field contains 
  1622.      the DN of the entry to be modified.  The server will not perform 
  1623.      any alias dereferencing in determining the object to be modified.
  1624.  
  1625.    - modification: A list of modifications to be performed on the entry.
  1626.      The entire list of entry modifications MUST be performed
  1627.      in the order they are listed, as a single atomic operation.  While
  1628.      individual modifications may violate the directory schema, the
  1629.      resulting entry after the entire list of modifications is performed
  1630.      MUST conform to the requirements of the directory schema. The
  1631.      values that may be taken on by the 'operation' field in each
  1632.      modification construct have the following semantics respectively:
  1633.  
  1634.              add: add values listed to the given attribute, creating
  1635.              the attribute if necessary;
  1636.  
  1637.              delete: delete values listed from the given attribute,
  1638.              removing the entire attribute if no values are listed, or
  1639.              if all current values of the attribute are listed for
  1640.              deletion;
  1641.  
  1642.              replace: replace all existing values of the given attribute
  1643.              with the new values listed, creating the attribute if it
  1644.              did not already exist.  A replace with no value will delete 
  1645.              the entire attribute.  
  1646.  
  1647.    The result of the modify attempted by the server upon receipt of a
  1648.    Modify Request is returned in a Modify Response, defined as follows:
  1649.  
  1650.         ModifyResponse ::= [APPLICATION 7] LDAPResult
  1651.    Upon receipt of a Modify Request, a server will perform the necessary
  1652.    modifications to the DIT.
  1653.  
  1654.    The server will return to the client a single Modify Response
  1655.    indicating either the successful completion of the DIT modification,
  1656.    or the reason that the modification failed. Note that due to the
  1657.    requirement for atomicity in applying the list of modifications in
  1658.    the Modify Request, the client may expect that no modifications of
  1659.    the DIT have been performed if the Modify Response received indicates
  1660.    any sort of error, and that all requested modifications have been
  1661.    performed if the Modify Response indicates successful completion of
  1662.    the Modify Operation.  If the connection fails, whether the 
  1663.    modification occurred or not is indeterminate.
  1664.  
  1665.    The Modify Operation cannot be used to remove from an entry any of 
  1666.    its distinguished values, those values which form the entry's 
  1667.    relative distinguished name.  An attempt to do so will result in the 
  1668.    server returning the error notAllowedOnRDN.  The Modify DN Operation
  1669.    described in section 4.9 is used to rename an entry.
  1670.  
  1671.    If an equality match filter has not been defined for an attribute type,
  1672.    clients MUST NOT attempt to delete individual values of that attribute
  1673.    from an entry using the "delete" form of a modification, and MUST
  1674.    instead use the "replace" form.
  1675. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 28
  1676.  
  1677. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1678.  
  1679.    Note that due to the simplifications made in LDAP, there is not a 
  1680.    direct mapping of the modifications in an LDAP ModifyRequest onto the 
  1681.    EntryModifications of a DAP ModifyEntry operation, and different
  1682.    implementations of LDAP-DAP gateways may use different means of 
  1683.    representing the change.  If successful, the final effect of the 
  1684.    operations on the entry MUST be identical.
  1685.  
  1686. 4.7. Add Operation
  1687.  
  1688.    The Add Operation allows a client to request the addition of an entry
  1689.    into the directory. The Add Request is defined as follows:
  1690.  
  1691.         AddRequest ::= [APPLICATION 8] SEQUENCE {
  1692.                 entry           LDAPDN,
  1693.                 attributes      AttributeList }
  1694.  
  1695.         AttributeList ::= SEQUENCE OF SEQUENCE {
  1696.                 type    AttributeDescription,
  1697.                 vals    SET OF AttributeValue }    
  1698.  
  1699.    Parameters of the Add Request are:
  1700.  
  1701.    - entry: the Distinguished Name of the entry to be added. Note that 
  1702.      the server will not dereference any aliases in locating the entry 
  1703.      to be added.
  1704.  
  1705.    - attributes: the list of attributes that make up the content of the 
  1706.      entry being added.  Clients MUST include distinguished values (those
  1707.      forming the entry's own RDN) in this list, the objectClass 
  1708.      attribute, and values of any mandatory attributes of the listed 
  1709.      object classes.  Clients MUST NOT supply the createTimestamp or 
  1710.      creatorsName attributes, since these will be generated 
  1711.      automatically by the server.
  1712.  
  1713.    The entry named in the entry field of the AddRequest MUST NOT exist 
  1714.    for the AddRequest to succeed.  The parent of the entry to be added
  1715.    MUST exist.  For example, if the client attempted to add 
  1716.    "CN=JS,O=Foo,C=US", the "O=Foo,C=US" entry did not exist, and the 
  1717.    "C=US" entry did exist, then the server would return the error 
  1718.    noSuchObject with the matchedDN field containing "C=US".  If the
  1719.    parent entry exists but is not in a naming context held by the 
  1720.    server, the server SHOULD return a referral to the server holding
  1721.    the parent entry.
  1722.  
  1723.    Servers implementations SHOULD NOT restrict where entries can be 
  1724.    located in the directory.  Some servers MAY allow the administrator to 
  1725.    restrict the classes of entries which can be added to the directory.
  1726.  
  1727.    Upon receipt of an Add Request, a server will attempt to perform the
  1728.    add requested.  The result of the add attempt will be returned to the
  1729.    client in the Add Response.
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 29
  1736.  
  1737. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1738.  
  1739.    The result of the add attempted by the server upon receipt of a Add
  1740.    Request is returned in the Add Response, defined as follows:
  1741.  
  1742.         AddResponse ::= [APPLICATION 9] LDAPResult
  1743.  
  1744.    A response of success indicates that the new entry is present in the
  1745.    directory. 
  1746.  
  1747. 4.8. Delete Operation
  1748.  
  1749.    The Delete Operation allows a client to request the removal of an
  1750.    entry from the directory. The Delete Request is defined as follows: 
  1751.  
  1752.         DelRequest ::= [APPLICATION 10] LDAPDN
  1753.  
  1754.    The Delete Request consists of the Distinguished Name of the
  1755.    entry to be deleted. Note that the server will not dereference 
  1756.    aliases while resolving the name of the target entry to be removed, 
  1757.    and that only leaf entries (those with no subordinate entries) can be 
  1758.    deleted with this operation.
  1759.     
  1760.    The result of the delete attempted by the server upon receipt of a 
  1761.    Delete Request is returned in the Delete Response, defined as follows:
  1762.  
  1763.         DelResponse ::= [APPLICATION 11] LDAPResult
  1764.  
  1765.    Upon receipt of a Delete Request, a server will attempt to perform
  1766.    the entry removal requested. The result of the delete attempt will be
  1767.    returned to the client in the Delete Response. 
  1768.  
  1769. 4.9. Modify DN Operation
  1770.  
  1771.    The Modify DN Operation allows a client to change the leftmost 
  1772.    (least significant) component of the name of an entry in the 
  1773.    directory, or to move a subtree of entries to a new location in the 
  1774.    directory.  The Modify DN Request is defined as follows:
  1775.  
  1776.         ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
  1777.                 entry           LDAPDN,
  1778.                 newrdn          RelativeLDAPDN,
  1779.                 deleteoldrdn    BOOLEAN,
  1780.                 newSuperior     [0] LDAPDN OPTIONAL }
  1781.                
  1782.    Parameters of the Modify DN Request are:
  1783.  
  1784.    - entry: the Distinguished Name of the entry to be changed.  This 
  1785.      entry may or may not have subordinate entries.
  1786.  
  1787.    - newrdn: the RDN that will form the leftmost component of the new 
  1788.      name of the entry.
  1789.  
  1790.    - deleteoldrdn: a boolean parameter that controls whether the old RDN
  1791.      attribute values are to be retained as attributes of the entry, or
  1792.      deleted from the entry.
  1793.  
  1794.  
  1795. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 30
  1796.  
  1797. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1798.  
  1799.    - newSuperior: if present, this is the Distinguished Name of the entry
  1800.      which becomes the immediate superior of the existing entry.
  1801.  
  1802.    The result of the name change attempted by the server upon receipt of
  1803.    a Modify DN Request is returned in the Modify DN Response, defined
  1804.    as follows:
  1805.  
  1806.         ModifyDNResponse ::= [APPLICATION 13] LDAPResult
  1807.  
  1808.    Upon receipt of a ModifyDNRequest, a server will attempt to
  1809.    perform the name change. The result of the name change attempt will
  1810.    be returned to the client in the Modify DN Response. 
  1811.  
  1812.    For example, if the entry named in the "entry" parameter was
  1813.    "cn=John Smith,c=US", the newrdn parameter was "cn=John Cougar Smith",
  1814.    and the newSuperior parameter was absent, then this operation would 
  1815.    attempt to rename the entry to be "cn=John Cougar Smith,c=US".  If 
  1816.    there was already an entry with that name, the operation would fail 
  1817.    with error code entryAlreadyExists.
  1818.   
  1819.    If the deleteoldrdn parameter is TRUE, the values forming the old
  1820.    RDN are deleted from the entry.  If the deleteoldrdn parameter is 
  1821.    FALSE, the values forming the old RDN will be retained as 
  1822.    non-distinguished attribute values of the entry.  The server may 
  1823.    not perform the operation and return an error code if the setting of 
  1824.    the deleteoldrdn parameter would cause a schema inconsistency in the
  1825.    entry.
  1826.  
  1827.    Note that X.500 restricts the ModifyDN operation to only affect 
  1828.    entries that are contained within a single server.  If the LDAP 
  1829.    server is mapped onto DAP, then this restriction will apply, and the 
  1830.    resultCode affectsMultipleDSAs will be returned if this error 
  1831.    occurred.  In general clients MUST NOT expect to be able to perform 
  1832.    arbitrary movements of entries and subtrees between servers.
  1833.  
  1834. 4.10. Compare Operation
  1835.  
  1836.    The Compare Operation allows a client to compare an assertion
  1837.    provided with an entry in the directory. The Compare Request is
  1838.    defined as follows:
  1839.  
  1840.         CompareRequest ::= [APPLICATION 14] SEQUENCE {
  1841.                 entry           LDAPDN,
  1842.                 ava             AttributeValueAssertion }
  1843.  
  1844.    Parameters of the Compare Request are:
  1845.  
  1846.    - entry: the name of the entry to be compared with.
  1847.  
  1848.    - ava: the assertion with which an attribute in the entry is to be 
  1849.      compared.
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 31
  1856.  
  1857. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1858.  
  1859.    The result of the compare attempted by the server upon receipt of a
  1860.    Compare Request is returned in the Compare Response, defined as
  1861.    follows:
  1862.  
  1863.         CompareResponse ::= [APPLICATION 15] LDAPResult 
  1864.  
  1865.    Upon receipt of a Compare Request, a server will attempt to perform
  1866.    the requested comparison. The result of the comparison will be
  1867.    returned to the client in the Compare Response. Note that errors and
  1868.    the result of comparison are all returned in the same construct.
  1869.  
  1870.    Note that some directory systems may establish access controls which
  1871.    permit the values of certain attributes (such as userPassword) to be 
  1872.    compared but not read.  In a search result, it may be that an 
  1873.    attribute of that type would be returned, but with an empty set of 
  1874.    values.
  1875.    
  1876. 4.11. Abandon Operation
  1877.  
  1878.    The function of the Abandon Operation is to allow a client to request
  1879.    that the server abandon an outstanding operation.  The Abandon
  1880.    Request is defined as follows:
  1881.  
  1882.         AbandonRequest ::= [APPLICATION 16] MessageID
  1883.  
  1884.    The MessageID MUST be that of a an operation which was requested 
  1885.    earlier in this connection.  
  1886.  
  1887.    (The abandon request itself has its own message id.  This is distinct
  1888.     from the id of the earlier operation being abandoned.)
  1889.  
  1890.    There is no response defined in the Abandon Operation. Upon
  1891.    transmission of an Abandon Operation, a client may expect that the
  1892.    operation identified by the Message ID in the Abandon Request has
  1893.    been abandoned. In the event that a server receives an Abandon
  1894.    Request on a Search Operation in the midst of transmitting 
  1895.    responses to the search, that server MUST cease transmitting entry 
  1896.    responses to the abandoned request immediately, and MUST NOT send the
  1897.    SearchResponseDone.  Of course, the server MUST ensure that only 
  1898.    properly encoded LDAPMessage PDUs are transmitted.
  1899.  
  1900.    Clients MUST NOT send abandon requests for the same operation multiple
  1901.    times, and MUST also be prepared to receive results from operations it
  1902.    has abandoned (since these may have been in transit when the abandon 
  1903.    was requested).
  1904.  
  1905.    Servers MUST discard abandon requests for message IDs they do not 
  1906.    recognize, for operations which cannot be abandoned, and for 
  1907.    operations which have already been abandoned.
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 32
  1916.  
  1917. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1918.  
  1919. 4.12. Extended Operation
  1920.  
  1921.    An extension mechanism has been added in this version of LDAP, in 
  1922.    order to allow additional operations to be defined for services not 
  1923.    available elsewhere in this protocol, for instance digitally signed 
  1924.    operations and results.
  1925.  
  1926.    The extended operation allows clients to make requests and receive 
  1927.    responses with predefined syntaxes and semantics.  These may be 
  1928.    defined in RFCs or be private to particular implementations.  Each 
  1929.    request MUST have a unique OBJECT IDENTIFIER assigned to it.
  1930.  
  1931.         ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
  1932.                 requestName      [0] LDAPOID,
  1933.                 requestValue     [1] OCTET STRING OPTIONAL }
  1934.  
  1935.    The requestName is a dotted-decimal representation of the 
  1936.    OBJECT IDENTIFIER corresponding to the request.  
  1937.    The requestValue is information in a form defined by that request, 
  1938.    encapsulated inside an OCTET STRING. 
  1939.  
  1940.    The server will respond to this with an LDAPMessage containing the 
  1941.    ExtendedResponse.
  1942.  
  1943.         ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
  1944.                 COMPONENTS OF LDAPResult,
  1945.                 responseName     [10] LDAPOID OPTIONAL,
  1946.                 response         [11] OCTET STRING OPTIONAL }
  1947.     
  1948.    If the server does not recognize the request name, it MUST return
  1949.    only the response fields from LDAPResult, containing the 
  1950.    protocolError result code.
  1951.  
  1952. 5.  Protocol Element Encodings and Transfer
  1953.  
  1954.    One underlying service is defined here.  Clients and servers SHOULD 
  1955.    implement the mapping of LDAP over TCP described in 5.2.1.
  1956.  
  1957. 5.1. Mapping Onto BER-based Transport Services
  1958.  
  1959.    The protocol elements of LDAP are encoded for exchange using the
  1960.    Basic Encoding Rules (BER) [11] of ASN.1 [3]. However, due to the
  1961.    high overhead involved in using certain elements of the BER, the
  1962.    following additional restrictions are placed on BER-encodings of LDAP
  1963.    protocol elements:
  1964.  
  1965.    (1) Only the definite form of length encoding will be used.
  1966.  
  1967.    (2) OCTET STRING values will be encoded in the primitive form only.
  1968.  
  1969.    (3) If the value of a BOOLEAN type is true, the encoding MUST have 
  1970.        its contents octets set to hex "FF".
  1971.  
  1972.  
  1973.  
  1974.  
  1975. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 33
  1976.  
  1977. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  1978.  
  1979.    (4) If a value of a type is its default value, it MUST be absent.  
  1980.        Only some BOOLEAN and INTEGER types have default values in this 
  1981.        protocol definition.
  1982.  
  1983.    These restrictions do not apply to ASN.1 types encapsulated inside of 
  1984.    OCTET STRING values, such as attribute values, unless otherwise noted.
  1985.  
  1986. 5.2. Transfer Protocols
  1987.  
  1988.    This protocol is designed to run over connection-oriented, reliable
  1989.    transports, with all 8 bits in an octet being significant in the data
  1990.    stream.  
  1991.  
  1992. 5.2.1. Transmission Control Protocol (TCP)
  1993.  
  1994.    The LDAPMessage PDUs are mapped directly onto the TCP bytestream.
  1995.    It is recommended that server implementations running over the TCP MAY
  1996.    provide a protocol listener on the assigned port, 389.  Servers may 
  1997.    instead provide a listener on a different port number. Clients MUST
  1998.    support contacting servers on any valid TCP port.
  1999.  
  2000. 6.  Implementation Guidelines
  2001.  
  2002.    This document describes an Internet protocol. Terms are defined in 
  2003.    [10].
  2004.  
  2005. 6.1. Server Implementations
  2006.  
  2007.    The server MUST be capable of recognizing all the mandatory attribute 
  2008.    type names and implement the syntaxes specified in [5].  Servers MAY
  2009.    also recognize additional attribute type names.
  2010.         
  2011. 6.2. Client Implementations
  2012.  
  2013.    Clients which request referrals MUST ensure that they do not loop
  2014.    between servers. They MUST NOT repeatedly contact the same server 
  2015.    for the same request with the same target entry name, scope and 
  2016.    filter.  Some clients may be using a counter that is incremented 
  2017.    each time referral handling occurs for an operation, and these 
  2018.    kinds of clients MUST be able to handle a DIT with at least ten 
  2019.    layers of naming contexts between the root and a leaf entry.
  2020.  
  2021.    In the absence of prior agreements with servers, clients SHOULD NOT 
  2022.    assume that servers support any particular schemas beyond those
  2023.    referenced in section 6.1. Different schemas can have different
  2024.    attribute types with the same names.  The client can retrieve 
  2025.    the subschema entries referenced by the subschemaSubentry attribute
  2026.    in the server's root DSE or in entries held by the server.
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 34
  2036.  
  2037. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  2038.  
  2039. 7.  Security Considerations
  2040.  
  2041.    When used with a connection-oriented transport, this version of the 
  2042.    protocol provides facilities for the LDAP v2 authentication mechanism,
  2043.    simple authentication using a cleartext password, as well as any SASL
  2044.    mechanism [12].  SASL allows for integrity and privacy services to be
  2045.    negotiated.
  2046.    
  2047.    It is also permitted that the server can return its credentials to the
  2048.    client, if it chooses to do so.
  2049.  
  2050.    An extension document [8] defines how LDAP can be used with the 
  2051.    Transport Layer Security (TLS) services, which can provide strong
  2052.    authentication, integrity and privacy of the association.
  2053.  
  2054.    Use of cleartext password is strongly discouraged where the underlying
  2055.    transport service cannot guarantee confidentiality and may result in 
  2056.    disclosure of the password to unauthorized parties.
  2057.  
  2058.    When used with SASL, it should be noted that the name field of the 
  2059.    BindRequest is not protected against modification.  Thus if the 
  2060.    distinguished name of the client (an LDAPDN) is agreed through the 
  2061.    negotiation of the credentials, it takes precedence over any value in 
  2062.    the unprotected name field.
  2063.  
  2064.    Implementations which cache attributes and entries obtained via LDAP 
  2065.    MUST ensure that access controls are maintained if that information is
  2066.    to be provided to multiple clients, since servers may have access 
  2067.    control policies which prevent the return of entries or attributes in
  2068.    search results except to particular authenticated clients.  For 
  2069.    example, caches could serve result information only to the client 
  2070.    whose request caused it to be cache.
  2071.  
  2072. 8.  Acknowledgements
  2073.  
  2074.    This document is an update to RFC 1777, by Wengyik Yeong, Tim 
  2075.    Howes, and Steve Kille.  Design ideas included in this document are 
  2076.    based on those discussed in ASID and other IETF Working Groups.  The 
  2077.    contributions of individuals in these working groups is gratefully 
  2078.    acknowledged.
  2079.  
  2080. 9.  Bibliography
  2081.  
  2082.    [1] ITU-T Rec. X.500, "The Directory: Overview of Concepts, Models and
  2083.        Service",  1993.
  2084.  
  2085.    [2] W. Yeong, T. Howes, S. Kille, "Lightweight Directory Access  
  2086.        Protocol", RFC 1777, March 1995.
  2087.  
  2088.    [3] ITU-T Rec. X.680, "Abstract Syntax Notation One (ASN.1) - 
  2089.        Specification of Basic Notation", 1994.
  2090.  
  2091.    [4] S. Kille, M. Wahl, "A UTF-8 String Representation of Distinguished
  2092.        Names", INTERNET-DRAFT <draft-ietf-asid-ldapv3-dn-03.txt>.
  2093.  
  2094.  
  2095. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 35
  2096.  
  2097. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  2098.  
  2099.    [5] M. Wahl, A. Coulbeck, T. Howes, S. Kille, W. Yeong, C. Robbins,
  2100.        "Lightweight Directory Access Protocol Attribute Syntax
  2101.        Definitions", INTERNET-DRAFT 
  2102.        <draft-ietf-asid-ldapv3-attributes-07.txt>, Aug. 1997.
  2103.  
  2104.    [6] ITU-T Rec. X.501, "The Directory: Models", 1993.
  2105.      
  2106.    [7] T. Berners-Lee, L. Masinter, M. McCahill, "Uniform Resource 
  2107.         Locators (URL)", RFC 1738, Dec. 1994.
  2108.  
  2109.    [8] J. Hodges, B. Morgan, M. Wahl, "Lightweight Directory Access
  2110.        Protocol (v3) Extension for Transport Layer Security", 
  2111.        INTERNET-DRAFT <draft-ietf-asid-ldapv3-tls-01.txt>, June 1997.
  2112.  
  2113.    [9] T. Howes, M. Smith, "The LDAP URL Format", INTERNET-DRAFT
  2114.        <draft-ietf-asid-ldapv3-url-03.txt>.
  2115.  
  2116.    [10] S. Bradner, "Key words for use in RFCs to Indicate Requirement 
  2117.         Levels", RFC 2119.
  2118.    
  2119.    [11] ITU-T Rec. X.690, "Specification of ASN.1 encoding rules: Basic, 
  2120.         Canonical, and Distinguished Encoding Rules", 1994.
  2121.  
  2122.    [12] J. Meyers, "Simple Authentication and Security Layer",
  2123.         INTERNET-DRAFT <draft-myers-auth-sasl-11.txt>.
  2124.  
  2125.    [13] Universal Multiple-Octet Coded Character Set (UCS) - Architecture
  2126.         and Basic Multilingual Plane, ISO/IEC 10646-1 : 1993.
  2127.    
  2128.    [14] F. Yergeau, "UTF-8, a transformation format of Unicode and ISO 
  2129.         10646", RFC 2044, October 1996.
  2130.  
  2131.    [15] ITU-T Rec. X.511, "The Directory: Abstract Service Definition", 
  2132.         1993.
  2133.  
  2134. 10. Authors' Address
  2135.  
  2136.        Mark Wahl
  2137.        Critical Angle Inc.
  2138.        4815 W Braker Lane #502-385
  2139.        Austin, TX 78759
  2140.        USA
  2141.  
  2142.        Phone:  +1 512 372-3160
  2143.        EMail:  M.Wahl@critical-angle.com
  2144.  
  2145.        Tim Howes
  2146.        Netscape Communications Corp.
  2147.        501 E. Middlefield Rd.
  2148.        Mountain View, CA 94043
  2149.        USA
  2150.        
  2151.        Phone:  +1 415 254-1900
  2152.        EMail:   howes@netscape.com
  2153.  
  2154.  
  2155. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 36
  2156.  
  2157. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  2158.  
  2159.        Steve Kille
  2160.        Isode Limited
  2161.        The Dome, The Square
  2162.        Richmond
  2163.        TW9 1DT
  2164.        UK
  2165.  
  2166.        Phone:  +44-181-332-9091
  2167.        EMail:  S.Kille@isode.com
  2168.  
  2169. Appendix A - Complete ASN.1 Definition
  2170.  
  2171.         Lightweight-Directory-Access-Protocol-V3 DEFINITIONS 
  2172.         IMPLICIT TAGS ::=
  2173.  
  2174.         BEGIN
  2175.  
  2176.         LDAPMessage ::= SEQUENCE {
  2177.                 messageID       MessageID,
  2178.                 protocolOp      CHOICE {
  2179.                         bindRequest     BindRequest,
  2180.                         bindResponse    BindResponse, 
  2181.                         unbindRequest   UnbindRequest, 
  2182.                         searchRequest   SearchRequest, 
  2183.                         searchResEntry  SearchResultEntry, 
  2184.                         searchResDone   SearchResultDone, 
  2185.                         searchResRef    SearchResultReference, 
  2186.                         modifyRequest   ModifyRequest, 
  2187.                         modifyResponse  ModifyResponse, 
  2188.                         addRequest      AddRequest,     
  2189.                         addResponse     AddResponse,    
  2190.                         delRequest      DelRequest, 
  2191.                         delResponse     DelResponse,    
  2192.                         modDNRequest    ModifyDNRequest, 
  2193.                         modDNResponse   ModifyDNResponse, 
  2194.                         compareRequest  CompareRequest, 
  2195.                         compareResponse CompareResponse, 
  2196.                         abandonRequest  AbandonRequest,  
  2197.                         extendedReq     ExtendedRequest,
  2198.                         extendedResp    ExtendedResponse },
  2199.                  controls       [0] Controls OPTIONAL }
  2200.  
  2201.         MessageID ::= INTEGER (0 .. maxInt)
  2202.  
  2203.         maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) --
  2204.  
  2205.         LDAPString ::= OCTET STRING
  2206.  
  2207.         LDAPOID ::= OCTET STRING 
  2208.  
  2209.         LDAPDN ::= LDAPString
  2210.  
  2211.         RelativeLDAPDN ::= LDAPString
  2212.  
  2213.         AttributeType ::= LDAPString
  2214.  
  2215. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 37
  2216.  
  2217. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  2218.         
  2219.         AttributeDescription ::= LDAPString
  2220.         
  2221.         AttributeDescriptionList ::= SEQUENCE OF 
  2222.                 AttributeDescription
  2223.  
  2224.         AttributeValue ::= OCTET STRING 
  2225.  
  2226.         AttributeValueAssertion ::= SEQUENCE {
  2227.                 attributeDesc   AttributeDescription,
  2228.                 assertionValue  AssertionValue }
  2229.  
  2230.         AssertionValue ::= OCTET STRING
  2231.  
  2232.         Attribute ::= SEQUENCE {
  2233.                 type    AttributeDescription,
  2234.                 vals    SET OF AttributeValue }
  2235.  
  2236.         MatchingRuleId ::= LDAPString
  2237.  
  2238.         LDAPResult ::= SEQUENCE {
  2239.                 resultCode      ENUMERATED {
  2240.                              success                      (0),
  2241.                              operationsError              (1),
  2242.                              protocolError                (2),
  2243.                              timeLimitExceeded            (3),
  2244.                              sizeLimitExceeded            (4),
  2245.                              compareFalse                 (5),
  2246.                              compareTrue                  (6),
  2247.                              authMethodNotSupported       (7),
  2248.                              strongAuthRequired           (8),
  2249.                                         -- 9 reserved --
  2250.                              referral                     (10),  -- new
  2251.                              adminLimitExceeded           (11),  -- new
  2252.                              unavailableCriticalExtension (12),  -- new
  2253.                              confidentialityRequired      (13),  -- new
  2254.                                         -- 14-15 unused --
  2255.                              noSuchAttribute              (16),
  2256.                              undefinedAttributeType       (17),
  2257.                              inappropriateMatching        (18),
  2258.                              constraintViolation          (19),
  2259.                              attributeOrValueExists       (20),
  2260.                              invalidAttributeSyntax       (21),
  2261.                                         -- 22-31 unused --
  2262.                              noSuchObject                 (32),
  2263.                              aliasProblem                 (33),
  2264.                              invalidDNSyntax              (34),
  2265.                              -- 35 reserved for undefined isLeaf --
  2266.                              aliasDereferencingProblem    (36),
  2267.                                         -- 37-47 unused --
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 38
  2276.  
  2277. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  2278.  
  2279.                              inappropriateAuthentication  (48),
  2280.                              invalidCredentials           (49),
  2281.                              insufficientAccessRights     (50),
  2282.                              busy                         (51),
  2283.                              unavailable                  (52),
  2284.                              unwillingToPerform           (53),
  2285.                              loopDetect                   (54),
  2286.                                         -- 55-63 unused --
  2287.                              namingViolation              (64),
  2288.                              objectClassViolation         (65),
  2289.                              notAllowedOnNonLeaf          (66),
  2290.                              notAllowedOnRDN              (67),
  2291.                              entryAlreadyExists           (68),
  2292.                              objectClassModsProhibited    (69),
  2293.                                         -- 70 reserved for CLDAP --
  2294.                              affectsMultipleDSAs          (71), -- new
  2295.                                         -- 72-79 unused --
  2296.                              other                        (80) },
  2297.                              -- 81-90 reserved for APIs --
  2298.                 matchedDN       LDAPDN,
  2299.                 errorMessage    LDAPString,
  2300.                 referral        [3] Referral OPTIONAL }
  2301.  
  2302.         Referral ::= SEQUENCE OF LDAPURL
  2303.  
  2304.         LDAPURL ::= LDAPString -- limited to characters permitted in URLs
  2305.  
  2306.         Controls ::= SEQUENCE OF Control
  2307.  
  2308.         Control ::= SEQUENCE {
  2309.                 controlType             LDAPOID,
  2310.                 criticality             BOOLEAN DEFAULT FALSE,
  2311.                 controlValue            OCTET STRING OPTIONAL }
  2312.  
  2313.         BindRequest ::= [APPLICATION 0] SEQUENCE {
  2314.                 version                 INTEGER (1 .. 127),
  2315.                 name                    LDAPDN,
  2316.                 authentication          AuthenticationChoice }
  2317.  
  2318.         AuthenticationChoice ::= CHOICE {
  2319.                 simple                  [0] OCTET STRING,
  2320.                                          -- 1 and 2 reserved
  2321.                 sasl                    [3] SaslCredentials }
  2322.  
  2323.         SaslCredentials ::= SEQUENCE {
  2324.                 mechanism               LDAPString,
  2325.                 credentials             OCTET STRING OPTIONAL }
  2326.  
  2327.         BindResponse ::= [APPLICATION 1] SEQUENCE {
  2328.              COMPONENTS OF LDAPResult,
  2329.              serverSaslCreds    [7] OCTET STRING OPTIONAL }
  2330.  
  2331.         UnbindRequest ::= [APPLICATION 2] NULL
  2332.  
  2333.  
  2334.  
  2335. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 39
  2336.  
  2337. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  2338.  
  2339.         SearchRequest ::= [APPLICATION 3] SEQUENCE {
  2340.                 baseObject      LDAPDN,
  2341.                 scope           ENUMERATED {
  2342.                         baseObject              (0),
  2343.                         singleLevel             (1),
  2344.                         wholeSubtree            (2) },
  2345.                 derefAliases    ENUMERATED {
  2346.                         neverDerefAliases       (0),
  2347.                         derefInSearching        (1),
  2348.                         derefFindingBaseObj     (2),
  2349.                         derefAlways             (3) },
  2350.                 sizeLimit       INTEGER (0 .. maxInt),
  2351.                 timeLimit       INTEGER (0 .. maxInt),
  2352.                 typesOnly       BOOLEAN,
  2353.                 filter          Filter,
  2354.                 attributes      AttributeDescriptionList }
  2355.  
  2356.         Filter ::= CHOICE {
  2357.                 and             [0] SET OF Filter,
  2358.                 or              [1] SET OF Filter,
  2359.                 not             [2] Filter,
  2360.                 equalityMatch   [3] AttributeValueAssertion,
  2361.                 substrings      [4] SubstringFilter,
  2362.                 greaterOrEqual  [5] AttributeValueAssertion,
  2363.                 lessOrEqual     [6] AttributeValueAssertion,
  2364.                 present         [7] AttributeDescription,
  2365.                 approxMatch     [8] AttributeValueAssertion,
  2366.                 extensibleMatch [9] MatchingRuleAssertion }     
  2367.  
  2368.         SubstringFilter ::= SEQUENCE {
  2369.                 type            AttributeDescription,
  2370.                 -- at least one must be present
  2371.                 substrings      SEQUENCE OF CHOICE { 
  2372.                         initial [0] LDAPString,
  2373.                         any     [1] LDAPString,
  2374.                         final   [2] LDAPString } }
  2375.  
  2376.         MatchingRuleAssertion ::= SEQUENCE {
  2377.                 matchingRule    [1] MatchingRuleId OPTIONAL,
  2378.                 type            [2] AttributeDescription OPTIONAL,
  2379.                 matchValue      [3] AssertionValue,
  2380.                 dnAttributes    [4] BOOLEAN DEFAULT FALSE }
  2381.  
  2382.         SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
  2383.                 objectName      LDAPDN,
  2384.                 attributes      PartialAttributeList }
  2385.  
  2386.         PartialAttributeList ::= SEQUENCE OF SEQUENCE { 
  2387.                 type    AttributeDescription,
  2388.                 vals    SET OF AttributeValue } 
  2389.  
  2390.         SearchResultReference ::= [APPLICATION 19] SEQUENCE OF LDAPURL
  2391.                
  2392.         SearchResultDone ::= [APPLICATION 5] LDAPResult
  2393.  
  2394.  
  2395. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 40
  2396.  
  2397. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  2398.  
  2399.         ModifyRequest ::= [APPLICATION 6] SEQUENCE {
  2400.                 object          LDAPDN,
  2401.                 modification    SEQUENCE OF SEQUENCE {
  2402.                         operation       ENUMERATED {
  2403.                                                 add     (0),
  2404.                                                 delete  (1),
  2405.                                                 replace (2) },
  2406.                         modification    AttributeTypeAndValues } }
  2407.  
  2408.         AttributeTypeAndValues ::= SEQUENCE {
  2409.                 type    AttributeDescription,
  2410.                 vals    SET OF AttributeValue }
  2411.  
  2412.         ModifyResponse ::= [APPLICATION 7] LDAPResult
  2413.  
  2414.         AddRequest ::= [APPLICATION 8] SEQUENCE {
  2415.                 entry           LDAPDN,
  2416.                 attributes      AttributeList }
  2417.  
  2418.         AttributeList ::= SEQUENCE OF SEQUENCE {
  2419.                 type    AttributeDescription,
  2420.                 vals    SET OF AttributeValue }    
  2421.  
  2422.         AddResponse ::= [APPLICATION 9] LDAPResult
  2423.  
  2424.         DelRequest ::= [APPLICATION 10] LDAPDN
  2425.  
  2426.         DelResponse ::= [APPLICATION 11] LDAPResult
  2427.  
  2428.         ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
  2429.                 entry           LDAPDN,
  2430.                 newrdn          RelativeLDAPDN,
  2431.                 deleteoldrdn    BOOLEAN,
  2432.                 newSuperior     [0] LDAPDN OPTIONAL }
  2433.                
  2434.         ModifyDNResponse ::= [APPLICATION 13] LDAPResult
  2435.  
  2436.         CompareRequest ::= [APPLICATION 14] SEQUENCE {
  2437.                 entry           LDAPDN,
  2438.                 ava             AttributeValueAssertion }
  2439.  
  2440.         CompareResponse ::= [APPLICATION 15] LDAPResult 
  2441.  
  2442.         AbandonRequest ::= [APPLICATION 16] MessageID
  2443.  
  2444.         ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
  2445.                 requestName      [0] LDAPOID,
  2446.                 requestValue     [1] OCTET STRING OPTIONAL }
  2447.  
  2448.         ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
  2449.                 COMPONENTS OF LDAPResult,
  2450.                 responseName     [10] LDAPOID OPTIONAL,
  2451.                 response         [11] OCTET STRING OPTIONAL }
  2452.  
  2453.         END
  2454.  
  2455. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 41
  2456.  
  2457. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  2458.  
  2459. Table of Contents 
  2460.  
  2461. 1.  Status of this Memo .................................... 1
  2462. 2.  Abstract ............................................... 1
  2463. 3.  Models ................................................. 2
  2464. 3.1. Protocol Model ........................................ 2
  2465. 3.2. Data Model ............................................ 3
  2466. 3.2.1. Attributes of Entries ............................... 3
  2467. 3.2.2. Subschema Entries and Subentries .................... 4
  2468. 3.3. Relationship to X.500 ................................. 5
  2469. 3.4. Server-specific Data Requirements ..................... 6
  2470. 4.  Elements of Protocol ................................... 6
  2471. 4.1. Common Elements ....................................... 7
  2472. 4.1.1. Message Envelope .................................... 7
  2473. 4.1.1.1. Message ID ........................................ 8
  2474. 4.1.2. String Types ........................................ 8
  2475. 4.1.3. Distinguished Name and Relative Distinguished Name .. 9
  2476. 4.1.4. Attribute Type ...................................... 9
  2477. 4.1.5. Attribute Description ............................... 10
  2478. 4.1.5.1. Binary Option ..................................... 11
  2479. 4.1.6. Attribute Value ..................................... 11
  2480. 4.1.7. Attribute Value Assertion ........................... 11
  2481. 4.1.8. Attribute ........................................... 12
  2482. 4.1.9. Matching Rule Identifier ............................ 12
  2483. 4.1.10. Result Message ..................................... 13
  2484. 4.1.11. Referral ........................................... 14
  2485. 4.1.12. Controls ........................................... 15
  2486. 4.2. Bind Operation ........................................ 16
  2487. 4.2.1. Sequencing of the Bind Request ...................... 17
  2488. 4.2.2. Authentication and Other Security Services .......... 18
  2489. 4.2.3. Bind Response ....................................... 19
  2490. 4.3. Unbind Operation ...................................... 19
  2491. 4.4. Unsolicited Notification .............................. 20
  2492. 4.4.1. Notice of Disconnection ............................. 20
  2493. 4.5. Search Operation ...................................... 21
  2494. 4.5.1. Search Request ...................................... 21
  2495. 4.5.2. Search Result ....................................... 25
  2496. 4.5.3. Continuation References in the Search Result ........ 26
  2497. 4.5.3.1. Example ........................................... 26
  2498. 4.6. Modify Operation ...................................... 27
  2499. 4.7. Add Operation ......................................... 29
  2500. 4.8. Delete Operation ...................................... 30
  2501. 4.9. Modify DN Operation ................................... 30
  2502. 4.10. Compare Operation .................................... 31
  2503. 4.11. Abandon Operation .................................... 32
  2504. 4.12. Extended Operation ................................... 33
  2505. 5.  Protocol Element Encodings and Transfer ................ 33
  2506. 5.1. Mapping Onto BER-based Transport Services ............. 33
  2507. 5.2. Transfer Protocols .................................... 34
  2508. 5.2.1. Transmission Control Protocol (TCP) ................. 34
  2509. 6.  Implementation Guidelines .............................. 34
  2510. 6.1. Server Implementations ................................ 34
  2511. 6.2. Client Implementations ................................ 34
  2512. 7.  Security Considerations ................................ 35
  2513. 8.  Acknowledgements ....................................... 35
  2514.  
  2515. Wahl,Howes,Kille  Lightweight Directory Access Protocol (v3)     Page 42
  2516.  
  2517. INTERNET-DRAFT      draft-ietf-asid-ldapv3-protocol-07.txt     Aug. 1997
  2518.  
  2519.  
  2520. 9.  Bibliography ........................................... 35
  2521. 10. Authors' Address ....................................... 36
  2522. Appendix A - Complete ASN.1 Definition ..................... 37
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.  
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575. <draft-ietf-asid-ldapv3-protocol-07.txt> Expires: February, 1998 Page 43
  2576.