<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc compact="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes"?>
<?rfc symrefs="yes"?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>

<rfc category="std" docName="draft-saintandre-tls-server-id-check-00" ipr="trust200902">

  <front>
    <title abbrev="TLS Server Identities">Best Practices for Checking of Server Identities in the Context of Transport Layer Security (TLS)</title>

    <author initials="P." surname="Saint-Andre" fullname="Peter Saint-Andre">
      <organization>Cisco</organization>
      <address>
        <email>psaintan@cisco.com</email>
      </address>
    </author>

    <author initials="K." surname="Zeilenga" fullname="Kurt D. Zeilenga">
      <organization>Isode Limited</organization>
      <address>
        <email>Kurt.Zeilenga@Isode.COM</email>
      </address>
    </author>

    <author initials="J." surname="Hodges" fullname="Jeff Hodges">
      <organization abbrev="NeuStar">NeuStar</organization>
      <address>
        <email>Jeff.Hodges@KingsMountain.com</email>
      </address>
    </author>

    <author initials="R.L." surname="Morgan" fullname="RL 'Bob' Morgan">
      <organization abbrev="Internet2">UWashington/Internet2</organization>
      <address>
        <email>rlmorgan@washington.edu</email>
      </address>
    </author>

    <date month="June" year="2009"/>
    <area>Applications</area>
    <workgroup>None</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>
      <t>This document specifies the how an entity establishing a TLS connection, or other PKI-based interaction, with a server should verify the server identity.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="sctn-intro" title="Introduction">
      <t>Establishing a TLS-based connection <xref target='TLS'/> with a server, or any other sort of client-server PKI-based interaction, entails, on the part of the client, verifying the &quot;server&apos;s identity&quot; based upon information presented by the server in its certificate correlated with the information about the server ensconced in the Domain Name System (DNS).</t>
      <t>Presently, various Internet-Drafts utilizing TLS or prescribing PKI-based interactions, either prescribe their own server identity check, or reference <xref target="LDAP-AUTH"/> or its predecesor <xref target="LDAP-TLS"/>. [there may be other I-Ds referencing other specs that describe the equivalent of server identity checks]</t>
      <t>Converging our present understanding of this critical aspect of PKI-based interactions is desirable in that it will hopefully encourage more coherence in specifications and actual implementations thereof, as well as ease the burden of crafting new specifications because this aspect has been factored out and separately standardized.</t>
      <t>This document extracts the &quot;server identity check&quot; section from <xref target="LDAP-AUTH"/>, with the goal of becoming a stand-alone BCP document appropriately referenceable by I-Ds and thus RFCs.</t>
    </section>

    <section anchor="sctn-terms" title="Terminology">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="TERMS"/>.</t>
    </section>

    <section anchor="sctn-server-ident-check" title="Server Identity Check">
      <t>In order to prevent man-in-the-middle attacks, the client MUST verify the server's identity (as presented in the server's Certificate message).  In this section, the client's understanding of the server's identity (typically the identity used to establish the transport connection) is called the "reference identity".</t>
      <t>The client determines the type (e.g., DNS name or IP address) of the reference identity and performs a comparison between the reference identity and each subjectAltName value of the corresponding type until a match is produced.  Once a match is produced, the server's identity has been verified, and the server identity check is complete.  Different subjectAltName types are matched in different ways.  Sections 3.1.3.1 - 3.1.3.3 explain how to compare values of various subjectAltName types.</t>
      <t>The client may map the reference identity to a different type prior to performing a comparison.  Mappings may be performed for all available subjectAltName types to which the reference identity can be mapped; however, the reference identity should only be mapped to types for which the mapping is either inherently secure (e.g., extracting the DNS name from a URI to compare with a subjectAltName of type dNSName) or for which the mapping is performed in a secure manner (e.g., using DNSSEC, or using user- or admin-configured host- to-address/address-to-host lookup tables).</t>
      <t>The server's identity may also be verified by comparing the reference identity to the Common Name (CN) <xref target='LDAP-SCHEMA'/> value in the leaf Relative Distinguished Name (RDN) of the subjectName field of the server's certificate.  This comparison is performed using the rules for comparison of DNS names in Section 3.1.3.1, below, with the exception that no wildcard matching is allowed.  Although the use of the Common Name value is existing practice, it is deprecated, and Certification Authorities are encouraged to provide subjectAltName values instead.  Note that the TLS implementation may represent DNs in certificates according to X.500 or other conventions.  For example, some X.500 implementations order the RDNs in a DN using a left-to-right (most significant to least significant) convention instead of LDAP's right-to-left convention.</t>
      <t>If the server identity check fails, user-oriented clients SHOULD either notify the user (clients may give the user the opportunity to continue with the LDAP session in this case) or close the transport connection and indicate that the server's identity is suspect.  Automated clients SHOULD close the transport connection and then return or log an error indicating that the server's identity is suspect or both.</t>
      <t>Beyond the server identity check described in this section, clients should be prepared to do further checking to ensure that the server is authorized to provide the service it is requested to provide.  The client may need to make use of local policy information in making this determination.</t>

      <section anchor="sctn-comp-dns-names" title="Comparison of DNS Names">
        <t>If the reference identity is an internationalized domain name, conforming implementations MUST convert it to the ASCII Compatible Encoding (ACE) format as specified in Section 4 of <xref target='IDNA'/> before comparison with subjectAltName values of type dNSName.  Specifically, conforming implementations MUST perform the conversion operation specified in Section 4 of RFC 3490 as follows:</t>
        <t>
          <list style="symbols">
            <t>in step 1, the domain name SHALL be considered a "stored string";</t>
            <t>in step 3, set the flag called "UseSTD3ASCIIRules";</t>
            <t>in step 4, process each label with the "ToASCII" operation; and</t>
            <t>in step 5, change all label separators to U+002E (full stop).</t>
          </list>
        </t> 
        <t>After performing the "to-ASCII" conversion, the DNS labels and names MUST be compared for equality according to the rules specified in Section 3 of RFC3490.</t>
        <t>The '*' (ASCII 42) wildcard character is allowed in subjectAltName values of type dNSName, and then only as the left-most (least significant) DNS label in that value.  This wildcard matches any left-most DNS label in the server name.  That is, the subject *.example.com matches the server names a.example.com and b.example.com, but does not match example.com or a.b.example.com.</t>
      </section>

      <section anchor="sctn-comp-ip-addrs" title="Comparison of IP Addresses">
        <t>When the reference identity is an IP address, the identity MUST be converted to the "network byte order" octet string representation <xref target='IP'/> <xref target='IPv6'/>.  For IP Version 4, as specified in RFC 791, the octet string will contain exactly four octets.  For IP Version 6, as specified in RFC 2460, the octet string will contain exactly sixteen octets.  This octet string is then compared against subjectAltName values of type iPAddress.  A match occurs if the reference identity octet string and value octet strings are identical.</t>
      </section>

      <section anchor="sctn-comp-other-subjname" title="Comparison of Other subjectName Types">
        <t>Client implementations MAY support matching against subjectAltName values of other types as described in other documents.</t>
      </section>
    </section>

    <section anchor="security" title="Security Considerations">
      <t>To follow.</t>
    </section>

  </middle>

  <back>

    <references title="Normative References">

<reference anchor='IDNA'>
<front>
<title>Internationalizing Domain Names in Applications (IDNA)</title>
<author initials='P.' surname='Faltstrom' fullname='P. Faltstrom'>
<organization /></author>
<author initials='P.' surname='Hoffman' fullname='P. Hoffman'>
<organization /></author>
<author initials='A.' surname='Costello' fullname='A. Costello'>
<organization /></author>
<date month='March' year='2003' /></front>
<seriesInfo name='RFC' value='3490' />
<format type='TXT' octets='51943' target='ftp://ftp.isi.edu/in-notes/rfc3490.txt' />
</reference>

<reference anchor='IP'>
<front>
<title abbrev='Internet Protocol'>Internet Protocol</title>
<author initials='J.' surname='Postel' fullname='Jon Postel'>
<organization>University of Southern California (USC)/Information Sciences Institute</organization>
<address>
<postal>
<street>4676 Admiralty Way</street>
<city>Marina del Rey</city>
<region>CA</region>
<code>90291</code>
<country>US</country></postal></address></author>
<date year='1981' day='1' month='September' /></front>
<seriesInfo name='STD' value='5' />
<seriesInfo name='RFC' value='791' />
<format type='TXT' octets='97779' target='ftp://ftp.isi.edu/in-notes/rfc791.txt' />
</reference>

<reference anchor='IPv6'>
<front>
<title abbrev='IPv6 Specification'>Internet Protocol, Version 6 (IPv6) Specification</title>
<author initials='S.E.' surname='Deering' fullname='Stephen E. Deering'>
<organization>Cisco Systems, Inc.</organization>
<address>
<postal>
<street>170 West Tasman Drive</street>
<street>San Jose</street>
<region>CA</region>
<code>95134-1706</code>
<country>USA</country></postal>
<phone>+1 408 527 8213</phone>
<facsimile>+1 408 527 8254</facsimile>
<email>deering@cisco.com</email></address></author>
<author initials='R.M.' surname='Hinden' fullname='Robert M. Hinden'>
<organization>Nokia</organization>
<address>
<postal>
<street>232 Java Drive</street>
<street>Sunnyvale</street>
<region>CA</region>
<code>94089</code>
<country>USA</country></postal>
<phone>+1 408 990 2004</phone>
<facsimile>+1 408 743 5677</facsimile>
<email>hinden@iprg.nokia.com</email></address></author>
<date year='1998' month='December' />
<area>Internet</area>
<keyword>internet protocol version 6</keyword>
<keyword>IPv6</keyword>
<abstract>
<t>
   This document specifies version 6 of the Internet Protocol (IPv6),
   also sometimes referred to as IP Next Generation or IPng.
</t></abstract></front>
<seriesInfo name='RFC' value='2460' />
<format type='TXT' octets='85490' target='ftp://ftp.isi.edu/in-notes/rfc2460.txt' />
<format type='HTML' octets='99496' target='http://xml.resource.org/public/rfc/html/rfc2460.html' />
<format type='XML' octets='93343' target='http://xml.resource.org/public/rfc/xml/rfc2460.xml' />
</reference>

<reference anchor='LDAP-AUTH'>
<front>
<title>Lightweight Directory Access Protocol (LDAP): Authentication Methods and Security Mechanisms</title>
<author initials='R.' surname='Harrison' fullname='R. Harrison'>
<organization /></author>
<date year='2006' month='June' />
<abstract>
<t>This document describes authentication methods and security mechanisms of the Lightweight Directory Access Protocol (LDAP). This document details establishment of Transport Layer Security (TLS) using the StartTLS operation.&lt;/t>&lt;t> This document details the simple Bind authentication method including anonymous, unauthenticated, and name/password mechanisms and the Simple Authentication and Security Layer (SASL) Bind authentication method including the EXTERNAL mechanism.&lt;/t>&lt;t> This document discusses various authentication and authorization states through which a session to an LDAP server may pass and the actions that trigger these state changes.&lt;/t>&lt;t> This document, together with other documents in the LDAP Technical Specification (see Section 1 of the specification's road map), obsoletes RFC 2251, RFC 2829, and RFC 2830. [STANDARDS TRACK]</t></abstract></front>
<seriesInfo name='RFC' value='4513' />
<format type='TXT' octets='80546' target='ftp://ftp.isi.edu/in-notes/rfc4513.txt' />
</reference>

<reference anchor='LDAP-SCHEMA'>
<front>
<title>Lightweight Directory Access Protocol (LDAP): Schema for User Applications</title>
<author initials='A.' surname='Sciberras' fullname='A. Sciberras'>
<organization /></author>
<date year='2006' month='June' />
<abstract>
<t>This document is an integral part of the Lightweight Directory Access Protocol (LDAP) technical specification.  It provides a technical specification of attribute types and object classes intended for use by LDAP directory clients for many directory services, such as White Pages.  These objects are widely used as a basis for the schema in many LDAP directories.  This document does not cover attributes used for the administration of directory servers, nor does it include directory objects defined for specific uses in other documents. [STANDARDS TRACK]</t></abstract></front>
<seriesInfo name='RFC' value='4519' />
<format type='TXT' octets='64996' target='ftp://ftp.isi.edu/in-notes/rfc4519.txt' />
</reference>

<reference anchor='TERMS'>
<front>
<title abbrev='RFC Key Words'>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='Scott Bradner'>
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass.  Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>sob@harvard.edu</email></address></author>
<date month='March' year='1997' />
<area>General</area>
<keyword>keyword</keyword>
<abstract>
<t>
   In many standards track documents several words are used to signify
   the requirements in the specification.  These words are often
   capitalized.  This document defines these words as they should be
   interpreted in IETF documents.  Authors who follow these guidelines
   should incorporate this phrase near the beginning of their document:

<list>
<t>
      The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL
      NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,  &quot;MAY&quot;, and
      &quot;OPTIONAL&quot; in this document are to be interpreted as described in
      RFC 2119.
</t></list></t>
<t>
   Note that the force of these words is modified by the requirement
   level of the document in which they are used.
</t></abstract></front>
<seriesInfo name='BCP' value='14' />
<seriesInfo name='RFC' value='2119' />
<format type='TXT' octets='4723' target='ftp://ftp.isi.edu/in-notes/rfc2119.txt' />
<format type='HTML' octets='14486' target='http://xml.resource.org/public/rfc/html/rfc2119.html' />
<format type='XML' octets='5661' target='http://xml.resource.org/public/rfc/xml/rfc2119.xml' />
</reference>

<reference anchor='TLS'>
<front>
<title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
<author initials='T.' surname='Dierks' fullname='T. Dierks'>
<organization /></author>
<author initials='E.' surname='Rescorla' fullname='E. Rescorla'>
<organization /></author>
<date year='2008' month='August' />
<abstract>
<t>This document specifies Version 1.2 of the Transport Layer Security (TLS) protocol.  The TLS protocol provides communications security over the Internet.  The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery. [STANDARDS TRACK]</t></abstract></front>
<seriesInfo name='RFC' value='5246' />
<format type='TXT' octets='222395' target='ftp://ftp.isi.edu/in-notes/rfc5246.txt' />
</reference>

    </references>

    <references title="Informative References">

<reference anchor='LDAP-TLS'>
<front>
<title>Lightweight Directory Access Protocol (v3): Extension for Transport Layer Security</title>
<author initials='J.' surname='Hodges' fullname='J. Hodges'>
<organization /></author>
<author initials='R.' surname='Morgan' fullname='R. Morgan'>
<organization /></author>
<author initials='M.' surname='Wahl' fullname='M. Wahl'>
<organization /></author>
<date year='2000' month='May' />
<abstract>
<t>This document defines the "Start Transport Layer Security (TLS) Operation" for LDAP. [STANDARDS TRACK]</t></abstract></front>
<seriesInfo name='RFC' value='2830' />
<format type='TXT' octets='24469' target='ftp://ftp.isi.edu/in-notes/rfc2830.txt' />
</reference>

    </references>

  </back>
</rfc>
