Re: [TLS] Proposed text for removing renegotiation

Eric Rescorla <ekr@rtfm.com> Sat, 07 June 2014 15:41 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CD7B61A0219 for <tls@ietfa.amsl.com>; Sat, 7 Jun 2014 08:41:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.377
X-Spam-Level:
X-Spam-Status: No, score=-1.377 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, J_CHICKENPOX_32=0.6, RCVD_IN_DNSWL_LOW=-0.7] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yvorKiL_C7M6 for <tls@ietfa.amsl.com>; Sat, 7 Jun 2014 08:41:58 -0700 (PDT)
Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 92D531A0190 for <tls@ietf.org>; Sat, 7 Jun 2014 08:41:57 -0700 (PDT)
Received: by mail-we0-f175.google.com with SMTP id p10so3990507wes.6 for <tls@ietf.org>; Sat, 07 Jun 2014 08:41:49 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=1OxIhma504rcASxT3osmx0QVgUbVCsS8JEsGqDuUggA=; b=ihhmO6VOb1fRsc0FzQUalgXAInoVcQMCBzGj3Hb/KXIISeZLhwbAYsEHIOQa4Y0+Oe OtO9OSFvp+1WBEA6KLRtox7D4PBgKGj49nJeC6s1S+tlbkTo65YUPZvcARLVlw3Ko+iU 9C8+Ics4OcJguKe0yNxhBgGvx7XnVv2in5XIgGnNgQEG5+gYovVkMdXuWD+AEB6grLpF NZoq+zKcGv/V+Z1lwBJtUFo7bAL95iooROsr4zchTwhPmYc1a9MAgaevxTftRVlmbtWl fuJBV3jmLBKP6N2kZtDSi//Gy3bCp3/3yfzM1bvlIPPZJnr2swxY6c5FF5ndZRkXK3SW py/Q==
X-Gm-Message-State: ALoCoQkCAoVgRwUHVd9l6E0IzezMK6r+1VCIsgy54nCD2TnxxbKiPN6nutuNYIi1GOu93MKniMMV
X-Received: by 10.180.212.112 with SMTP id nj16mr15145217wic.1.1402155709306; Sat, 07 Jun 2014 08:41:49 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.218.198 with HTTP; Sat, 7 Jun 2014 08:41:08 -0700 (PDT)
X-Originating-IP: [74.95.2.168]
In-Reply-To: <CACsn0cmcc6kXvOuqkZaDj7+QPdpY9qqQ58bs3s-JBGXdNJSZyw@mail.gmail.com>
References: <CAFewVt65X1V6=A_HP_pcg=6nXNVFLxQmSsPB2rq1KvmGPRz+og@mail.gmail.com> <20140606223045.3B5AF1AD46@ld9781.wdf.sap.corp> <CACsn0cmcc6kXvOuqkZaDj7+QPdpY9qqQ58bs3s-JBGXdNJSZyw@mail.gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Sat, 7 Jun 2014 08:41:08 -0700
Message-ID: <CABcZeBPe45BM-uXd7DEBD_BBn=jhk8KkYB=facp+NMb2e4nBiw@mail.gmail.com>
To: Watson Ladd <watsonbladd@gmail.com>
Content-Type: multipart/alternative; boundary=001a11c2401af934b004fb40d0e2
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/noCPYqATOewBgRvbuNfmvv4qRT8
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Proposed text for removing renegotiation
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 07 Jun 2014 15:42:00 -0000

On Sat, Jun 7, 2014 at 7:58 AM, Watson Ladd <watsonbladd@gmail.com> wrote:

> On Fri, Jun 6, 2014 at 3:30 PM, Martin Rex <mrex@sap.com> wrote:
> > Brian Smith wrote:
> >> Martin Rex <mrex@sap.com> wrote:
> >>>
> >>> Conceptually, the TLS session cache is readonly after an entry
> >>> is created, and that is GOOD, i.e. full TLS handshakes create new,
> >>> distict session cache entries, and abbreviated TLS handshakes resume
> >>> existing session cache entries and *NEVER* modify them.
> >>
> >> That is not true. During session resumption, the server can send a new
> >> session ticket for the existing session and the client has the option of
> >> adding the new ticket to the session (and removing the old ticket).
> >>
> >> Also often timestamps (e.g. for LRU replacement bookkeeping) and/or
> >> counters (e.g. for cache hit rate statistics) in a session are updated
> >> during resumption, though these are "just" implementation issues.
> >
> >
> > With "conceptually", I referred to the requirements of the specification,
> > not to the details of certain implementations of it.  Counting how often
> > sessions are resumed is nothing that the spec requires, and how you
> > manage your cache entries (expiration) is not in scope of that concept.
> >
> > When the read-only concept is violated, and implementations start
> scribbling
> > over _state_ of sessions that are in the cache during resumption
> > handshakes, it may result in problems such as these:
>
> What about this solution: separate TLS into a handshake and transport.
> The handshake computes a connection key associated with the ticket,
> then the transport computes a transport key based on that key and some
> conceptually separate random data from both sides exchanged in the
> handshake. When the transport is exhausted or we resume, the random
> numbers change, but the connection key does not.


To some extent TLS already does try to make this separation, with
separate "TLS Record Protocol" (Section 6) and "TLS Handshaking
Protocols" (Section 7) with the handshake protocol establishing a
Master Secret for the entire session which is then used to derive
distinct record keys every time you reconnect (resume) in the same
session, with diversity provided by the random values. So, arguably,
TLS already behaves this way, with the exception of dealing with
cryptographic exhaustion of the transport keys (e.g., GCM counter
rollover).

MT's basic suggestion is to fix the cryptographic exhaustion
problem by having a signal to re-generate new transport level keys
from the Master Secret. AFAIK this doesn't require any new random
exchange because you already have existing random values that
provide per-connection diversity, so you just need to generate new
crypto keys, e.g., by cranking the PRF again starting with the PRF
and the random values and some sort of iteration count and doesn't
require any conceptual changes to the TLS session cache model
of the kind that Martin Rex is discussion.


Where things get interesting is that this solely addresses exhaustion
but not PFS [0] I.e., as long as the Master Secret is stored somewhere
(e.g., the session cache) then an attacker who recovers it can
recover all the traffic keys. Traditionally, if you renegotiate without
resumption (i.e., do a fresh key exchange), then you can address
this issue, but if we remove renegotiation, that option is no longer
available. That leaves us with a number of options:

- Tell people they just need to reconnect if they want to limit the
   exposure of a given session (i.e., do nothing).

- Provide a mechanism for re-keying the connection in a way that
  allows you to destroy the previous keys [1]. However, this still
  runs afoul of the fact that the Master Secret needs to be available
  to generate the connection keys. You can deal with this in two
  major ways:

  (a) Tell people not to use resumption (i.e., not to store the MS in the
        session cache) if they want to provide this feature.
  (b) Change the value stored in the session cache so it can only be
        used to make new connections but not to decrypt old ones.
        AFAIK this requires being willing to change the session cache [2]

Or perhaps there's some clever idea I haven't thought of...

Best,
-Ekr


[0] Maybe we need a new term other than PFS for this particular
security feature.

[1] E.g., have a per-connection "Connection Master Key" generated
from the MS and then used to generate the traffic keys. When you
initially connection, you would compute CMS[0] = PRF(MS, Randoms)
and then do Traffic Keys = PRF(CMS[0], ...). Then when the keys
were exhausted you would do CMS[1] = PRF(CMS[0], ...) and recompute
the traffic keys with CMS[1].  Since the PRF is notionally irreversible,
an attacker with access to the keys after the key change couldn't
decrypt old traffic.

[2] Vigorous handwaving: the trivial thing to do is just to have MS[0],
MS[1], MS[2], etc. where every time you resume you generate the next
generation MS and destroy the old one. Obviously this requires changing
the session cache data, which is undesirable for the reasons indicated
by Martin Rex.