<?xml version="1.0" encoding="us-ascii"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.2.0 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC5246 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY RFC6347 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.6347.xml">
<!ENTITY I-D.ietf-tls-tls13 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tls-tls13.xml">
<!ENTITY I-D.ietf-tls-dtls13 SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tls-dtls13.xml">
<!ENTITY I-D.ietf-tls-dtls-connection-id SYSTEM "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-tls-dtls-connection-id.xml">
<!ENTITY foo "record header extension">
<!ENTITY Foo "Record header extension">
<!ENTITY FOO "Record Header Extension">
]>

<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>

<rfc ipr="trust200902" docName="draft-fossati-tls-ext-header-00" category="std" updates="RFC5246, RFC6347">

  <front>
    <title>Record Header Extensions for TLS and DTLS</title>

    <author initials="T." surname="Fossati" fullname="Thomas Fossati">
      <organization>Nokia</organization>
      <address>
        <email>thomas.fossati@nokia.com</email>
      </address>
    </author>
    <author initials="N." surname="Mavrogiannopoulos" fullname="Nikos Mavrogiannopoulos">
      <organization>RedHat</organization>
      <address>
        <email>nmav@redhat.com</email>
      </address>
    </author>

    <date year="2018" month="January" day="24"/>

    <area>Security</area>
    <workgroup>TLS Working Group</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>This document proposes a mechanism to extend the record header in TLS and DTLS.  To that aim, the (D)TLS header is modified as follows: the length field is trimmed to 15 bits, and the length's top bit is given the "&foo; indicator" semantics, allowing a sender to signal that one or more &foo;s have been added to this record.  We define the generic format of a &foo; and the general rules associated with its handling.  Any details regarding syntax, semantics and negotiation of a specific &foo;, are left to future documents.</t>



    </abstract>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<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"/>.</t>

</section>
<section anchor="length-redefined" title="Length Redefined">

<t>Both TLS (<xref target="RFC5246"/>, <xref target="I-D.ietf-tls-tls13"/>) and DTLS (<xref target="RFC6347"/>, <xref target="I-D.ietf-tls-dtls13"/>) require the size of TLS record payloads to not exceed 2^14 bytes - plus a small amount that accounts for compression or AEAD expansion.  This means that the first bit in the length field of the TLS record header is, in fact, unused.</t>

<t>The proposal (<xref target="fig-length-redefined"/>) is to shorten the length field to 15 bits and use the top bit (E) to signify the presence / absence of a &foo;.</t>

<figure title="Length redefined" anchor="fig-length-redefined"><artwork><![CDATA[
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+
|  ContentType  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Version            |E|            Length           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~             (zero or more) Extension Header(s)                ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Payload (including optional MAC and padding)          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork></figure>

<t>Length counts the bytes of Payload and of all &foo;s that are added to this record (possibly none).</t>

<t>In the reminder, the top bit is called the E-bit.</t>

</section>
<section anchor="foo" title="&FOO;">

<section anchor="ext-header-format" title="Format">

<t>If the E-bit is asserted, then a &foo; is appended to the regular header with the following format:</t>

<figure><artwork><![CDATA[
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-----------+
|M| Type  |       Length        | Value ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-----------+
]]></artwork></figure>

<t>Where:</t>

<t><list style="symbols">
  <t>M(ore) has the same semantics as the E-bit in the regular header - i.e.: if it is asserted then another extension header follows this one;</t>
  <t>Type is a fixed length (4-bits) field that defines the way Value has to be interpreted;</t>
  <t>Length is the size of Value in bytes.  It uses 11 bits, therefore allowing a theoretical maximum size of 2047 bytes for any &foo;;</t>
  <t>Value is the &foo; itself.</t>
</list></t>

<t>The fact that Type only allows 16 &foo; is a precise design choice: the allocation pool size is severely constrained so to raise the entry bar for any new &foo;.</t>

</section>
<section anchor="ext-header-nego" title="Negotiation">

<t>A &foo; is allowed only if it has been negotiated via a companion TLS extension.</t>

<t>An endpoint MUST NOT send a &foo; that hasn't been successfully negotiated with the receiver.</t>

<t>An endpoint that receives an unexpected &foo; MUST abort the session.</t>

<t>&Foo;s MUST NOT be sent during the initial handshake phase.</t>

</section>
<section anchor="ext-header-backwards-compat" title="Backwards Compatibility">

<t>A legacy endpoint that receives a &foo; will interpret it as an invalid length field (<xref target="RFC5246"/>, <xref target="I-D.ietf-tls-tls13"/>) and abort the session accordingly.</t>

<t>Note that this is equivalent to the behaviour of an endpoint implementing this spec which receives a non-negotiated &foo;.</t>

</section>
<section anchor="ext-header-and-cid" title="Use with Connection ID">

<t>A plausible use of this mechanism is with the CID extension defined in <xref target="I-D.ietf-tls-dtls-connection-id"/>.</t>

<t>In that case, the companion &foo; could be defined as follows:</t>

<t><list style="symbols">
  <t>Type: 0x0 (i.e., CID &foo;);</t>
  <t>Value: the CID itself</t>
</list></t>

<t>A DTLS 1.2 record carrying a CID "AB" would be formatted as in <xref target="fig-cid-example"/>:</t>

<t><list style="symbols">
  <t>E=1</t>
  <t>Type=0x0</t>
  <t>Length=0x002</t>
  <t>Value=0x4142</t>
</list></t>

<figure title="CID header example" anchor="fig-cid-example"><artwork><![CDATA[
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+-+-+-+-+-+-+-+-+
|  ContentType  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Version            |             Epoch             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Sequence Number                        |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |1|            Length           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|0|  0x0  |       0x002         |            0x4142             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|         Payload (including optional MAC and padding)          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork></figure>

<t>Note that, compared to all other possible ways to express presence/absence of a CID field within the constraints of the current header format (e.g., bumping the Version field, assigning new ContentType(s), using an invalid length), an ad hoc &foo; provides a cleaner approach that can be used with any TLS version at a reasonable cost - an overhead of 2 bytes per record.</t>

</section>
</section>
<section anchor="sec-cons" title="Security Considerations">

<t>An on-path active attacker could try and modify an existing &foo;, insert a new &foo; in an existing session, or alter the result of the negotiation in order to add or remove arbitrary &foo;s.  Given the security properties of TLS, none of the above can be tried without being fatally noticed by the endpoints.</t>

<t>A passive on-path attacker could potentially extrapolate useful knowledge about endpoints from the information encoded in a &foo; (see also <xref target="priv-cons"/>).</t>

</section>
<section anchor="priv-cons" title="Privacy Considerations">

<t>The extent and consequences of metadata leakage from endpoints to path when using a certain &foo; SHALL be assessed in the document that introduces this new &foo;.  If needed, the document SHALL describe the relevant risk mitigations.</t>

</section>
<section anchor="iana-cons" title="IANA Considerations">

<t>This document defines a new IANA registry that, for each new &foo;, shall provide its Type code-point.</t>

</section>
<section anchor="acknowledgements" title="Acknowledgements">

<t>TODO</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>

&RFC2119;
&RFC5246;
&RFC6347;
&I-D.ietf-tls-tls13;
&I-D.ietf-tls-dtls13;


    </references>

    <references title='Informative References'>

&I-D.ietf-tls-dtls-connection-id;


    </references>



  </back>

</rfc>
