<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc PUBLIC "-//IETF//DTD RFC 2629//EN"
                     "http://xml.resource.org/authoring/rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC5246 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY RFC6066 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6066.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<?rfc comments="no"?>
<?rfc inline="no"?>
<!-- end of list of popular I-D processing instructions -->
<rfc ipr="trust200902" docName="draft-balfanz-tls-obc-01">
  <!-- ***** FRONT MATTER ***** -->
  <front>
    <title abbrev="TLS OBC">TLS Origin-Bound Certificates</title>
    <author fullname="Dirk Balfanz" initials="D.B." role="editor" surname="Balfanz">
      <organization>Google Inc.</organization>
      <address>
        <postal>
          <street>1600 Ampitheatre Parkway</street>
          <!-- Reorder these if your country does things differently -->
          <city>Mountain View</city>
          <region>CA</region>
          <code/>
          <country>USA</country>
        </postal>
        <phone/>
        <email>balfanz@google.com</email>
        <!-- uri and facsimile elements may also be added -->
      </address>
    </author>
    <author fullname="D K Smetters" initials="D.S." surname="Smetters">
      <organization>Google Inc.</organization>
    </author>
    <author fullname="Mayank Upadhyay" initials="M.U." surname="Upadhyay">
      <organization>Google Inc.</organization>
    </author>
    <author fullname="Adam Barth" initials="A.B." surname="Barth">
      <organization>Google Inc.</organization>
    </author>
    <date month="November" year="2011"/>
    <!-- Meta-data Declarations -->
    <area>General</area>
    <workgroup>Internet Engineering Task Force</workgroup>
    <keyword>TLS</keyword>
    <keyword>PKI</keyword>
    <abstract>
      <t>This document specifies a Transport Layer Security (TLS)
      extension and associated semantics that allow clients and
      servers to negotiate the use of origin-bound, self-signed
      certificates for TLS client authentication.</t>
    </abstract>
  </front>
  <middle>

    <section title="Introduction">
      <t>Transport Layer Security (<xref target="RFC5246">TLS</xref>)
      allows clients to authenticate themselves using Client
      Certificates. In practice, clients tend to ask for user consent
      before using Client Certificates. This is to allay privacy
      concerns about user-identifying information in the Client
      Certificate, and also to let the user choose among possibly many
      certificates that can be used by the client for the TLS
      session.</t>

      <t>The user experience of obtaining this consent, along with
      that of obtaining the certificates in the first place, has
      traditionally presented a hurdle to user adoption. Additionally,
      operational constraints on the server side can make it difficult
      for service providers to switch from a cookie-based
      authentication scheme to certificate-based TLS client
      authentication.</t>

      <t>The TLS Origin-Bound Certificates extension (TLS-OBC) is a
      <xref target="RFC6066">TLS extension</xref> that allows clients
      to use certificate-based client authentication without having to
      obtain user consent before using certificates. A client creates
      at most one (self-signed) certificate of any given type (e.g.,
      rsa_sign or ecdsa_sign) per <xref target="WebOrigin">web
      origin</xref>, and does not include user-identifying information
      into such origin-bound certificates, thus making user consent
      and user-assisted certificate selection unnecessary.</t>

      <section title="Requirements Language">
        <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="RFC2119">RFC 2119</xref>.</t>
      </section>

      <section title="Extension Dependencies">
	<t>The client SHOULD use TLS-OBC during a TLS session only if
	it also uses the <xref target="EncryptedClientCerts">TLS
	Encrypted Client Certificates</xref> extension during that TLS
	session.</t>
      </section>
    </section>

    <section title="Origin-Bound Certificates">
      <t>An origin-bound certificate is a self-issued certificate that
      the client uses for TLS client authentication for a particular
      <xref target="WebOrigin">web origin</xref>. Origin-bound
      certificates MUST be self-signed, i.e., a private key
      corresponding to the certified public key MUST be used to sign
      the certificate.</t>
      
      <t>Clients MUST NOT re-use the same origin-bound certificate
      for more than one web origin.</t>

      <section title="Certificate Creation">
	<t>Clients create origin-bound certificates when asked to
        perform TLS client authentication after negotiating the <spanx
        style="verb">ob_cert</spanx> extension with a server from
	that origin (see <xref target="ClientCertificateMessage"/>),
	and they do not already have a valid origin-bound certificate
	for that origin available for use.</t>

	<t>Clients SHOULD NOT re-use the same key pair for more than
        one origin-bound certificate. To do so would violate the
        privacy properties required by origin-bound certificates.</t>
      
	<t>When creating an origin-bound certificate, it is
        RECOMMENDED that clients use the PrintableString
        representation of "anonymous.invalid" as the common name
        component of the Distinguished Name of both the certificate's
        Issuer and Subject, with no other name components present.</t>
      
	<t>It is RECOMMENDED that clients pick a lifetime for the
	new certificate between one month and one year (perhaps
	depending on an assessment of how well the private key is
	protected on the host platform). The client SHALL use the
	notBefore and notAfter fields in the new certificate to
	record the lifetime of the new certificate.</t>

	<section title="Origin-Bound Certificate Extension" anchor="x509extension">
	
	  <t>Origin-bound certificates MUST be X.509 v3 certificates,
	  and MUST include the origin-bound certificate extension (OID
	  1.3.6.1.4.1.11129.2.1.6), shown below.  This extension MUST
	  be marked critical.</t>

	  <t>The data of the extension, <spanx
          style="verb">OriginBoundCertificate</spanx>, will be the
          ASCII Serialization of the certificate's <xref
          target="WebOrigin">web origin</xref> as an IA5String.</t>

	  <figure anchor='figure_extension'>
	    <artwork>
 id-ce-originBoundCertificate OBJECT IDENTIFIER ::=
         { enterprises Google 2 1 6 }

 OriginBoundCertificate ::= 
         IA5String
	    </artwork>
	  </figure>
	  <t>The server MAY reject the origin-bound certificate if it
	  determines that the web origin included in the <spanx
	  style="verb">OriginBoundCertificate</spanx> extension does
	  not match the server's origin (for example, if it doesn't
	  match the host name specified in the Server Name Indication
	  TLS extension). It is, however, RECOMMENDED that the server
	  merely report the value of the web origin to the upper
	  layers in the protocol stack, and leave it up to those
	  layers to make use of the web origin value (e.g., to assist
	  developers in debugging the feature).</t>
	</section>
      </section>

      <section title="Certificate and Key Rotation">
	<t>After a client has created an origin-bound certificate for
	a certain web origin, the client SHOULD re-use the certificate
	for a period of time, and then discard it.</t>

	<t>The client MUST discard existing origin-bound certificate
	at or before the notAfter time indicated in each
	certificate.</t>

	<t>The client MAY opt to discard an existing origin-bound
	certificate at any time of its choosing prior to the notAfter
	time indicated in the certificate. In particular, the client
	may delete an existing origin-bound certificate in response to
	a user request to clear privacy-sensitive state from their
	user-agent, ensuring that a fresh certificate will be
	generated the next time a user visits that origin.</t>

	<t>The client SHOULD use a new key pair when it generates a new
	origin-bound certificate.</t>
      </section>
    </section>
    
    <section title="Changes to The Handshake Message Contents">
      <section title="Extension Definition">
	<t>This document defines a new TLS extension, <spanx
	style="verb">ob_cert</spanx> (with tentative extension type
	13175, or 0x3377), which indicates that client and server agree to allow
	the client to use an origin-bound certificate to authenticate
	itself to the server.</t> 

	<t>To indicate support for origin-bound certificates, the
	client includes an extension of type <spanx
	style="verb">ob_cert</spanx> in the Extended Client Hello
	message. To indicate that a subsequent CertificateRequest
	message requests an origin-bound certificate, the server
	includes the same extension in its Extended Server Hello
	message.</t>

	<t>The <spanx style="verb">ob_cert</spanx> TLS extension will
	be assigned a value from the TLS ExtensionType registry, and
	will contain zero
	length <spanx style="verb">extension_data</spanx>. For
	testing, we will use the extension type value of 0x3377. For
	this type value, the entire encoding of the extension will be
	33 77 00 00.
       </t>
      </section>

      <section title="Client Hello">
	<t>A client wishing to indicate support for origin-bound
        client certificates MUST include the <spanx
        style="verb">ob_cert</spanx> in the extended Client Hello
        message to a server from a particular web origin.
	</t>
      </section>

      <section title="Server Hello" >
	<t>A server that receives a Client Hello message containing
	the <spanx style="verb">ob_cert</spanx> extension MAY choose
	to include the same extension in the extended Server Hello
	message. If it does, the client and server are considered to
	have negotiated origin-bound client certificates for the
	session.</t>
      </section>

      <section title="Certificate Request">	
	<t>A server MAY choose to send a Certificate Request message
	to the client. If the session uses origin-bound client
	certificates, the server SHOULD use an empty <spanx
	style="verb">certificate_authorities</spanx> list.</t>

	<t>A client that receives a Certificate Request during a
	session for which origin-bound client certificates were
	negotiated MUST ignore the <spanx
	style="verb">certificate_authorities</spanx> list.</t>
      </section>

      <section anchor="ClientCertificateMessage" title="Client Certificate">
	<t><xref target="RFC5246">TLS</xref> requires that a client
	that receives a Certificate Request message must send a Client
	Certificate message in response (which may or may not include
	client certificates). If client and server negotiated
	origin-bound client certificates, then the client SHOULD
	include an origin-bound certificate in the Client Certificate
	message.</t>
	
	<t>If a client includes an origin-bound certificate in the
	Client Certificate message during a session for which
	origin-bound client certificates were negotiated, the included
	certificate MUST
        <list style="symbols">
	    <t>be an origin-bound certificate for the web origin of
	    the server, and </t> 

	    <t>match a certificate type requested by the server in the
	    Certificate Request message.</t>
	</list></t>

	<t>If a client doesn't possess a certificate meeting the above
	requirements, it SHOULD self-issue a certificate of a type
	requested by the server in the Certificate Request message and
	include the newly-generated certificate in the Client
	Certificate message. Only if the client is not capable of
	providing a certificate of the requested type SHOULD it
	include an empty <spanx style="verb">certificate_list</spanx>
	in the Client Certificate message.</t>

	<t>A server verifying a Client Certificate message in a
	  handshake that negotiated origin-bound client certificates
	  MUST verify that the certificate is self-signed, rather than
	  being signed by any particular CA. The server MUST verify
	  that the public key in the certificate corresponds to the
	  key used to authenticate the client in the handshake. The
	  server SHOULD ignore the Issuer and Subject in the presented
	  certificate. The server MUST ignore the notBefore and
	  notAfter fields in the certificate.</t>

        <t>Finally, the server MUST verify that the certificate
	  contains the origin-bound extension, and MAY verify that the
	  origin identified in that certificate matches the server
	  (see <xref target="x509extension"/>).</t>
      </section>
    </section>

    <section title="Security Considerations">
      <section title="Third-Party Tracking">
	<t>A third party might be able to track a client across
	multiple sessions by observing the use of the same
	origin-bound certificate. To alleviate this concern, clients
	SHOULD also implement the <xref
	target="EncryptedClientCerts">Encrypted Client Certificates
	Extension</xref>, and use it concurrently with TLS-OBC. The
	<xref target="EncryptedClientCerts">Encrypted Client
	Certificates Extension</xref> ensures that the origin-bound
	certificate is sent after TLS established secrecy on the
	channel between client and server.</t>
      </section>
    
      <section title="Server Tracking">
	<t>A client can prevent server tacking by deleting the
	origin-bound certificate for the server's Web origin. This
	could happen, for example, when the user elects to remove all
	cookies for that origin.</t>
      </section>

      
      <section title="Cookie Hardening">
	<t>One way TLS-OBC can be used to strengthen cookie-based
	authentication is by "binding" cookies to an origin-bound
	certificate. The server, when issuing a cookie for an HTTP
	session, would associate the client's origin-bound certificate
	with the session (either by encoding information about the
	certificate unforgeably in the cookie, or by associating the
	certificate with the cookie's session through some other
	means). That way, if and when a cookie gets stolen from a
	client, it cannot be used over a TLS connection initiated by a
	different client - the cookie thief would also have to steal
	the private key associated with the client's origin-bound
	certificate, a task considerably harder especially when we
	assume the existence of a Trusted Platform Module or other
	Secure Element that can store the origin-bound-certificate's
	private key.</t>
      </section>

      <section title="Key Lengths">
	<t>If the client uses RSA key pairs, the key length should be
	at least 1024 bits. For longer-lived origin-bound
	certificates, the key length should be 2048 bits.</t>

	<t>If the client uses ECDSA key pairs, the key length should
	be at least 160 bits.</t>
      </section>
    </section>
  </middle>
  <!-- *****BACK MATTER ***** -->
  <back>
    <references>
      &RFC2119;

      &RFC5246;

      &RFC6066;

     <reference anchor="WebOrigin"
	target="http://tools.ietf.org/html/draft-abarth-origin-09">
	<front>
	  <title>The Web Origin Concept</title>
	  <author initials="A.B." surname="Barth" fullname="Adam Barth">
	  </author>
	</front>
      </reference>

     <reference anchor="EncryptedClientCerts"
	target="http://tools.ietf.org/html/draft-agl-tls-encryptedclientcerts">
	<front>
	  <title>TLS Encrypted Client Certificates</title>
	  <author initials="A.L." surname="Langley" fullname="Adam Langley">
	  </author>
	</front>
      </reference>

    </references>
    <!-- Change Log

  -->
  </back>
</rfc>

