<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='./rfc2629.xslt' ?>

<?rfc toc="yes"?>
<?rfc symrefs="no"?>
<?rfc compact="no" ?>
<?rfc sortrefs="yes" ?>
<?rfc strict="yes" ?>
<?rfc linkmailto="yes" ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" >

<?xml-stylesheet type='text/xsl' href='./rfc2629.xslt' ?>

<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc compact="no" ?>
<?rfc subcompact="yes" ?>
<?rfc sortrefs="yes" ?>
<rfc ipr="trust200902" docName="draft-gutmann-tls-lts-00.txt" category="std">

  <!-- ======================================================================== -->
  <front>
    <title abbrev="TLS-LTS">TLS 1.2 Long-term Support Profile</title>
    <author initials="P." surname="Gutmann" fullname="Peter Gutmann">
      <organization abbrev="University of Auckland">University of Auckland</organization>
      <address>
        <postal>
          <street>Department of Computer Science</street>
          <city>University of Auckland</city>
          <city>Auckland</city>
          <country>New Zealand</country>
        </postal>
        <email>pgut001@cs.auckland.ac.nz</email>
      </address>
    </author>
    <date year="2016"/>
    <area>Security Area</area>
    <workgroup>TLS Working Group</workgroup>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <t>

This document specifies a profile of TLS 1.2 for long-term support, one that
represents what's already deployed for TLS 1.2 but with the security holes and
bugs fixed.  This represents a stable, known-good profile that can be deployed
now to systems that can't can't roll out patches every month or two when the
next attack on TLS is published.

      </t>
    </abstract>
  </front>
  <!-- ======================================================================== -->
  <middle>

    <!-- ====================================================================== -->
    <section anchor="introduction" title="Introduction">
      <t>

<xref target="TLS">TLS</xref> and <xref target="DTLS">DTLS</xref>, by nature
of their enormous complexity and the inclusion of large amounts of legacy
material, contain numerous security issues that have been known to be a
problem for many years and that keep coming up again and again in attacks
(there are simply too many of these to provide references for, and in any case
more will have been published by the time you read this).  This document
presents a minimal, known-good profile of mechanisms that defend against all
currently-known weaknesses in TLS, that would have defended against them ten
years ago, and that have a good chance of defending against them ten years
from now, providing the long-term stability that's required by many systems in
the field.

      </t>
      <t>

In particular it takes inspiration from numerous published analyses of TLS

<xref target="TLS-Analysis-1"/> <xref target="TLS-Analysis-2"/>
<xref target="TLS-Analysis-3"/> <xref target="TLS-Analysis-4"/>
<xref target="TLS-Analysis-5"/> <xref target="TLS-Analysis-6"/>
<xref target="TLS-Analysis-7"/> <xref target="TLS-Analysis-8"/>

to select a standard interoperable feature set that provides the best chance
of long-term stability and resistance to attack.  This is intended for use in
systems that need to run in a fixed configuration for a long time after
they're deployed, with little or no ability to roll out patches every month or
two when the next attack on TLS is published.

      </t>
      <t>

Unlike the full TLS 1.2, TLS-LTS is not meant to be all things to all people.
It represents a fixed, safe solution that's appropriate for users who require
a simple, secure, and long-term stable means of getting data from A to B. This
represents the majority of the non-browser use of TLS, particularly in the
embedded systems that are most in need of a long-term stable protocol profile.

      </t>
      <section anchor="mustshouldmay" title="Conventions Used in This Document">
        <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>
    <!-- ====================================================================== -->
    <section anchor="negotiation" title="TLS-LTS">
      <t>

The use of TLS-LTS is negotiated via TLS/DTLS extensions as defined in <xref
target="TLS-Ext">TLS Extensions</xref>.  On connecting, the client includes
the tls_lts extension in its client_hello if it wishes to use the TLS-LTS
profile.  If the server is capable of meeting this requirement, it responds
with an tls_lts in its server_hello.  The "extension_type" value for this
extension SHALL be TBD (0xTBD) and the "extension_data" field of this
extension SHALL be empty.  The client and server MUST NOT use the TLS-LTS
profile unless both sides have successfully exchanged tls_lts extensions.

      </t>
      <section anchor="negotiation_rationale" title="Rationale">
        <t>

The use of extensions precludes use with SSL 3.0, but then it's likely that
anything still using this nearly two decades-old protocol will be vulnerable
to any number of other attacks anyway, so there seems little point in bending
over backwards to accomodate SSL 3.0.

        </t>
      </section>
    </section>
    <!-- ====================================================================== -->
    <section anchor="tls-lts_profile" title="The TLS-LTS Profile">
      <section title="Encryption/Authentication">
        <t>

TLS-LTS restricts the more or less unlimited TLS 1.2 with its more than three
hundred cipher suites, over forty ECC parameter sets, and zoo of supplementary
algorithms, parameters, and parameter formats, to just two, one traditional
one with DHE + AES-CBC + HMAC-SHA-256 + RSA-SHA-256/PSK and one ECC one with
ECDHE-P256 + AES-GCM + HMAC-SHA-256 + ECDSA-P256-SHA-256/PSK with uncompressed
points:

        </t>
        <t><list style="symbols"><t>

TLS-LTS implementations MUST support TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
TLS_DHE_PSK_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
and TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256.  As the use of SHA-256 with RSA or
ECDSA is implicit in TLS-LTS, there is no need to signal it via the
signature_algorithms extension.  In addition the almost universally-ignored
requirement that all certificates provided by the server must be signed by the
algorithm(s) specified in the signature_algorithms extension is removed both
implicitly by not sending the extension and explicitly by removing this
requirement.  As the use of P256 with uncompressed points is implicit in
TLS-LTS, there is no need to signal it via the elliptic_curves and
ec_point_formats extensions.

        </t></list></t>

<figure><artwork><![CDATA[
    [Question: There's a gap in the suites with
     TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 missing, although it's
     present for all manner of non-AES ciphers, should we specify
     TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 or fill the current hole
     with TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256?].
]]></artwork></figure>

        <t>

TLS-LTS only permits encrypt-then-MAC, not MAC-then-encrypt, fixing 20 years
of attacks on this mechanism:

        </t>
        <t><list style="symbols"><t>

TLS-LTS implementations MUST implement
<xref target="EtM">encrypt-then-MAC</xref> rather than the earlier
MAC-then-encrypt.  As the use of encrypt-then-MAC is implicit in TLS-LTS,
there is no need to signal it via the encrypt_then_mac extension.

        </t></list></t>
        <t>

TLS-LTS drops the IPsec cargo-cult MAC truncation, which serves no obvious
purpose and leads to security concerns:

        </t>
        <t><list style="symbols"><t>

TLS-LTS implementations MUST use full-length MAC values (for example 256 bits
for SHA-256).  In particular MAC values MUST NOT be truncated to 96 bits/12
bytes, removing the verify_data_length constraint in the Finished message.

        </t></list></t>
        <t>

TLS-LTS recommends that implementations take measures to protect against side-
channel attacks:

        </t>
        <t><list style="symbols"><t>

Implementations SHOULD take steps to protect against timing attacks, for
example by using constant-time implementations of algorithms and by using
blinding for non-randomised algorithms like RSA.

        </t></list></t>
        <t><list style="symbols"><t>

Implementations SHOULD take steps to protect against fault attacks, in
particular for the extremely brittle ECC algorithms whose typical failure mode
if a fault occurs is to leak the private key.  One simple countermeasure is to
use the public key to verify any signatures generated before they are sent
over the wire.

        </t></list></t>

<figure><artwork><![CDATA[
    [Question: Should the PRF be replaced with HKDF?  There's no
     pressing need for this, but it could be part of the general
     cleanup].
]]></artwork></figure>

      </section>
      <section title="Message Formats">
        <t>

TLS-LTS sends the full set of DH parameters, X9.42/FIPS 186 style, not p and g
only, PKCS #3 style.  This allows verification of the DH parameters, which the
current format doesn't allow:

        </t>
        <t><list style="symbols"><t>

TLS-LTS implementations MUST send the DH domain parameters as { p, g, q }
rather than { p, g }.  This makes the ServerDHParams field:

          <figure><artwork><![CDATA[
struct {
    opaque dh_p<1..2^16-1>;
    opaque dh_g<1..2^16-1>;
    opaque dh_q<1..2^16-1>;
    opaque dh_Ys<1..2^16-1>;
    } ServerDHParams;     /* Ephemeral DH parameters */
          ]]></artwork></figure>

The domain parameters MUST be verified as specified in <xref
target="FIPS-186">FIPS 186</xref>.

        </t></list></t>
        <t>

TLS-LTS adds a hash of the domain parameters into the master secret to protect
against the use of manipulated curves/domain parameters:

        </t>
        <t><list style="symbols"><t>

TLS-LTS implementations MUST include a SHA-256 hash of the EDH or ECDH
parameters in the master secret computation by concatenating the hash to the
pre_master_secret value.  In the case of EDH, the value that's hashed is the
ServerDHParams structure.  In the case of ECDH the value that's hashed is the
ServerECDHParams structure.  This means that the master_secret computation
becomes:

          <figure><artwork><![CDATA[
master_secret = PRF(pre_master_secret || param_hash, "master secret",
                    ClientHello.random + ServerHello.random)
                    [0..47];
          ]]></artwork></figure>

        </t></list></t>
      </section>
      <section title="Miscellaneous">
        <t>

TLS-LTS drops the need to send the current time in the random data, which
serves no obvious purpose and leaks the client/server's time to attackers:

        </t>
        <t><list style="symbols"><t>

TLS-LTS implementations SHOULD NOT include the time in the Client/ServerHello
random data.  The data SHOULD consists entirely of random bytes.

        </t></list></t>
        <t>

TLS-LTS drops compression and rehandshake, which have led to a number of
attacks:

        </t>
        <t><list style="symbols"><t>

TLS-LTS implementations MUST NOT implement compression or rehandshake.

        </t></list></t>
      </section>
      <section title="Implementation Issues">
        <t>

TLS-LTS requires that RSA signature verification be done as
encode-then-compare, which fixes all known padding-manipulation issues:

        </t>
        <t><list style="symbols"><t>

TLS-LTS implementations MUST verify RSA signatures by using
encode-then-compare, meaning that they encode the expected signature result
and perform a constant-time compare against the recovered signature data.

        </t></list></t>
        <t>

The TLS protocol has historically and somewhat arbitrarily been described as a
state machine, which has led to a number of implementation flaws when state
transitions weren't very carefully considered and enforced.  A more logical
means of representing the protocol is as a ladder diagram, which hardcodes the
transitions into the diagram and removes the need to juggle a large amount of
state:

        </t>
        <t><list style="symbols"><t>

Implementations SHOULD consider representing/implementing the protocol as a
ladder diagram rather than a state machine, since the state-diagram form has
led to a number of implementation errors in the past which are avoided through
the use of the ladder diagram form.

        </t></list></t>
      </section>

      <section anchor="tls-lts_rationale" title="Rationale">
        <t>

A question that may be asked at this point is, why not use TLS 1.3 instead of
creating a secure profile of TLS 1.2?  The reason is that TLS 1.3 rolls back
the 20 years of experience that we have with all the things that can go wrong
in TLS and starts again from scratch with an almost entirely new protocol
based on bleeding-edge/experimental ideas, mechanisms, and algorithms.  When
SSLv3 was introduced, it used ideas that were 10-20 years old (DH, RSA, DES,
and so on were all long-established algorithms, only SHA-1 was relatively
new). These were mature algorithms with large amounts of of research published
on them, and yet we're still fixing issues with them 20 years later (the DH
algorithm was published in 1976, SSLv3 dates from 1996, and the latest DH
issue, Logjam, dates from 2015.

        </t>
        <t>

With TLS 1.3 we currently have zero implementation and deployment experience,
which means that we're likely to have another 10-20 years of patching holes
and fixing protocol and implementation problems ahead of us.  It's for this
reason that this profile uses the decades of experience we have with SSL and
TLS to simplify TLS 1.2 into a known-good subset that leverages about 15 years
of analysis and 20 years of implementation experience, rather than betting on
what's almost an entirely new protocol based on bleeding-edge/experimental
ideas, mechanisms, and algorithms.  The intent is to create a long-term stable
protocol profile that can be deployed once, not deployed and then patched,
updated, and fixed constantly for the lifetime of the equipment that it's used
with.

        </t>
      </section>
    </section>
    <!-- ====================================================================== -->
    <section anchor="security" title="Security Considerations">
      <t>

This document defines a minimal, known-good subset of TLS 1.2 that attempts to
address all known weaknesses in the protocol, mostly by simply removing
known-insecure mechanisms but also by updating the ones that remain to take
advantage of many years of security research and implementation experience.

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

IANA has added the extension code point TBD (0xTBD) for the tls_lts extension
to the TLS ExtensionType values registry as specified in
<xref target="TLS">TLS</xref>.

      </t>
    </section>
    <!-- ====================================================================== -->
    <section anchor="ack" title="Acknowledgements">
      <t>

The author would like to thank the members of the TLS mailing list for their
feedback on this document.

      </t>
    </section>
    <!-- ====================================================================== -->

  </middle>
  <!-- ======================================================================== -->
  <back>

    <references title="Normative References">

      <reference anchor='RFC2119'>
        <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>
          </author>
          <date year='1997' month='March' />
          <area>General</area>
          <keyword>keyword</keyword>
        </front>
        <seriesInfo name='BCP' value='14' />
        <seriesInfo name='RFC' value='2119' />
        <format type='TXT' target='ftp://ftp.isi.edu/in-notes/rfc2119.txt' />
        <format type='HTML' target='http://xml.resource.org/public/rfc/html/rfc2119.html' />
        <format type='XML' 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 fullname="Tim Dierks" initials="T" surname="Dierks">
            <organization>Independent</organization>
          </author>
          <author fullname="Eric Rescorla" initials="E" surname="Rescorla">
            <organization>RTFM, Inc.</organization>
          </author>
          <date year='2008' month='August' />
        </front>
        <seriesInfo name='RFC' value='5246' />
        <format type='TXT' target='http://www.ietf.org/rfc/rfc5246.txt' />
      </reference>

      <reference anchor='TLS-Ext'>
        <front>
          <title>Transport Layer Security (TLS) Extensions</title>
          <author fullname="Donald Eastlake 3rd" initials="D" surname="Eastlake 3rd">
            <organization>Huawei</organization>
          </author>
          <date year='2011' month='January' />
        </front>
        <seriesInfo name='RFC' value='6066' />
        <format type='TXT' target='http://www.ietf.org/rfc/rfc6066.txt' />
      </reference>

      <reference anchor='DTLS'>
        <front>
          <title>Datagram Transport Layer Security Version 1.2</title>
          <author fullname="Eric Rescorla" initials="E" surname="Rescorla">
            <organization>RTFM, Inc.</organization>
          </author>
          <author fullname="Nagendra Modadugu" initials="N" surname="Modadugu">
            <organization>Stanford University</organization>
          </author>
          <date year='2012' month='January' />
        </front>
        <seriesInfo name='RFC' value='6347' />
        <format type='TXT' target='http://www.ietf.org/rfc/rfc6347.txt' />
      </reference>

      <reference anchor='EtM'>
        <front>
          <title>Encrypt-then-MAC for Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)</title>
          <author fullname="Peter Gutmann" initials="P" surname="Gutmann">
            <organization>University of Auckland</organization>
          </author>
          <date year='2014' month='September' />
        </front>
        <seriesInfo name='RFC' value='7366' />
        <format type='TXT' target='http://www.ietf.org/rfc/rfc7366.txt' />
      </reference>

      <reference anchor='FIPS-186'>
        <front>
          <title>Digital Signature Standard (DSS)</title>
          <author fullname="NIST"></author>
          <date year='2013' month='July' />
        </front>
        <seriesInfo name='FIPS' value='186' />
      </reference>

    </references>
    <references title="Informative References">

      <reference anchor='TLS-Analysis-1'>
        <!-- No-one seems to know how to reference publications like
             conference proceedings in RFC-XML, this is one attempt... -->
        <front>
          <title>Proving the TLS handshake secure (as is)</title>
          <author fullname="Karthikeyan Bhargavan" initials="K" surname="Bhargavan"></author>
          <author fullname="Cedric Fournet" initials="C" surname="Fournet"></author>
          <author fullname="Markulf Kohlweiss" initials="M" surname="Kohlweiss"></author>
          <author fullname="Alfredo Pironti" initials="A" surname="Pironti"></author>
          <author fullname="Pierre-Yves Strub" initials="P" surname="Strub"></author>
          <author fullname="Santiago Zanella-Beguelin" initials="S" surname="Zanella-Beguelin"></author>
          <date year='2014' month='August' />
<!--      <note>Proceedings of Crypto'14, Springer-Verlag LNCS No.8617, p.235</note> -->
        </front>
        <seriesInfo name='Springer-Verlag LNCS' value='8617' />
      </reference>

      <reference anchor='TLS-Analysis-2'>
        <!-- No-one seems to know how to reference publications like
             conference proceedings in RFC-XML, this is one attempt... -->
        <front>
          <title>Less is more: relaxed yet compatible security notions for key exchange</title>
          <author fullname="C. Brzuska" initials="C" surname="Brzuska"></author>
          <author fullname="M. Fischlin" initials="M" surname="Fischlin"></author>
          <author fullname="N.P. Smart" initials="N" surname="Smart"></author>
          <author fullname="B. Warinschi" initials="B" surname="Warinschi"></author>
          <author fullname="S.C. Williams" initials="S" surname="Williams"></author>
          <date year='2012' month='April' />
<!--      <note>IACR ePrint archive, Report 2012/242</note> -->
        </front>
        <seriesInfo name='IACR ePrint archive' value='2012/242' />
      </reference>

      <reference anchor='TLS-Analysis-3'>
        <!-- No-one seems to know how to reference publications like
             conference proceedings in RFC-XML, this is one attempt... -->
        <front>
          <title>Modelling ciphersuite and version negotiation in the TLS protocol</title>
          <author fullname="Benjamin Dowling" initials="B" surname="Dowling"></author>
          <author fullname="Douglas Stebila" initials="D" surname="Stebila"></author>
          <date year='2015' month='June' />
<!--      <note>Proceedings of ACISP'15, Springer-Verlag LNCS No.9144, p.270</note> -->
        </front>
        <seriesInfo name='Springer-Verlag LNCS' value='9144' />
      </reference>

      <reference anchor='TLS-Analysis-4'>
        <!-- No-one seems to know how to reference publications like
             conference proceedings in RFC-XML, this is one attempt... -->
        <front>
          <title>Analysis of the Transport Layer Security protocol</title>
          <author fullname="Tia Helene Firing" initials="T" surname="Firing"></author>
          <date year='2010' month='June' />
<!--      <note>Norwegian University of Science and Technology MSc Thesis</note> -->
        </front>
      </reference>

      <reference anchor='TLS-Analysis-5'>
        <!-- No-one seems to know how to reference publications like
             conference proceedings in RFC-XML, this is one attempt... -->
        <front>
          <title>Universally Composable Security Analysis of TLS</title>
          <author fullname="Sebastian Gajek" initials="S" surname="Gajek"></author>
          <author fullname="Mark Manulis" initials="M" surname="Manulis"></author>
          <author fullname="Olivier Pereira" initials="O" surname="Pereira"></author>
          <author fullname="Ahmad-Reza Sadeghi" initials="A" surname="Sadeghi"></author>
          <author fullname="Joerg Schwenk" initials="J" surname="Schwenk"></author>
          <date year='2008' month='November' />
<!--      <note>Proceedings of ProvSec'08, Springer-Verlag LNCS No.5324, p.313</note> -->
        </front>
        <seriesInfo name='Springer-Verlag LNCS' value='5324' />
      </reference>

      <reference anchor='TLS-Analysis-6'>
        <!-- No-one seems to know how to reference publications like
             conference proceedings in RFC-XML, this is one attempt... -->
        <front>
          <title>On the security of TLS renegotiation</title>
          <author fullname="Florian Giesen" initials="F" surname="Giesen"></author>
          <author fullname="Florian Kohlar" initials="F" surname="Kohlar"></author>
          <author fullname="Douglas Stebila" initials="D" surname="Stebila"></author>
          <date year='2013' month='November' />
<!--      <note>Proceedings of CCS'13, p.387</note> -->
        </front>
        <seriesInfo name='ACM CCS' value='2013' />
      </reference>

      <reference anchor='TLS-Analysis-7'>
        <!-- No-one seems to know how to reference publications like
             conference proceedings in RFC-XML, this is one attempt... -->
        <front>
          <title>On the security of TLS-DHE in the standard model</title>
          <author fullname="Tibor Jager" initials="T" surname="Jager"></author>
          <author fullname="Florian Kohlar" initials="F" surname="Kohlar"></author>
          <author fullname="Sven Schaege" initials="S" surname="Schaege"></author>
          <author fullname="Joerg Schwenk" initials="J" surname="Schwenk"></author>
          <date year='2012' month='August' />
<!--      <note>Proceedings of Crypto'12, Springer-Verlag LNCS No.7417, p.273</note> -->
        </front>
        <seriesInfo name='Springer-Verlag LNCS' value='7417' />
      </reference>

      <reference anchor='TLS-Analysis-8'>
        <!-- No-one seems to know how to reference publications like
             conference proceedings in RFC-XML, this is one attempt... -->
        <front>
          <title>On the security of the TLS protocol</title>
          <author fullname="Hugo Krawczyk" initials="H" surname="Krawczyk"></author>
          <author fullname="Kenneth Paterson" initials="K" surname="Paterson"></author>
          <author fullname="Hoeteck Wee" initials="H" surname="Wee"></author>
          <date year='2013' month='August' />
<!--      <note>Proceedings of Crypto'13, Springer-Verlag LNCS No.8042, p.429</note> -->
        </front>
        <seriesInfo name='Springer-Verlag LNCS' value='8042' />
      </reference>

      <reference anchor='DownGradeSCSV'>
        <front>
          <title>TLS Fallback Signaling Cipher Suite Value (SCSV) for Preventing Protocol Downgrade Attacks</title>
          <author fullname="Bodo Moeller" initials="B" surname="Moeller">
            <organization>Google Switzerland Gmbh</organization>
          </author>
          <author fullname="Adam Langley" initials="A" surname="Langley">
            <organization>Google Inc.</organization>
          </author>
          <date year='2013' month='November' />
        </front>
        <seriesInfo name='RFC' value='XXXX' />
        <format type='TXT' target='http://tools.ietf.org/id/draft-bmoeller-tls-downgrade-scsv-01.txt' />
      </reference>

    </references>
    <!-- ====================================================================== -->
  </back>
</rfc>
