Re: [TLS] Encrypting ALPN and other unused extensions

Eric Rescorla <ekr@rtfm.com> Fri, 25 April 2014 15:33 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 E77171A03B3 for <tls@ietfa.amsl.com>; Fri, 25 Apr 2014 08:33:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
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 7NAKznbtQOd0 for <tls@ietfa.amsl.com>; Fri, 25 Apr 2014 08:33:54 -0700 (PDT)
Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by ietfa.amsl.com (Postfix) with ESMTP id 5D2631A063F for <tls@ietf.org>; Fri, 25 Apr 2014 08:33:48 -0700 (PDT)
Received: by mail-wg0-f48.google.com with SMTP id l18so3806537wgh.19 for <tls@ietf.org>; Fri, 25 Apr 2014 08:33:41 -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=T8r6Nb+HSxAFaHLYFfBXISPa5ycguclNa9PkKKkigJE=; b=JzlScii8v8mHMWQROK2UoSMGYSD3GvOlHZX10U5yrCycWtFbQDxTpoLoec6JbpzCMD DAJQ+QaCueaXFllZAejiJ6jDsg1Pmh6belBms3jKasoDfwH6OSFLLIzZgMkQEjEB1K+O kJ23zQ9f7s1q849IP/Sc8crrtB8L5Pjfkv3J7RVe8dn1urnyY2rFEpzHur2uWWtjvhxG jZ5GlgfrcFPr0q9ubN9h0E7R+3GpB/xBJW0x97UrdWlRSn0/OtVBpVUezoNC5lJ64ttn CWbdQi051n7ABZrViGC3vTyeXlLv1ptSSY43y2Myh2ajfFrS4x6MCGiJFiEzKtLEakX5 /K/Q==
X-Gm-Message-State: ALoCoQk3Arq1TX0mfTuSkLa6KQ98O+lJjOGtptUWGjKxrITUnqqg2N1goEQ7yHoTbEmI0L1zsw/k
X-Received: by 10.180.81.228 with SMTP id d4mr4173481wiy.49.1398440021298; Fri, 25 Apr 2014 08:33:41 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.218.198 with HTTP; Fri, 25 Apr 2014 08:33:00 -0700 (PDT)
X-Originating-IP: [173.196.57.82]
In-Reply-To: <CACsn0cmq6LD31HXhoSL52zZga7K=F4oet+jp0s1XJWhN0dy_Lw@mail.gmail.com>
References: <CACsn0cmq6LD31HXhoSL52zZga7K=F4oet+jp0s1XJWhN0dy_Lw@mail.gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Fri, 25 Apr 2014 08:33:00 -0700
Message-ID: <CABcZeBNmq9Cj6BNkse80zxs5m5UzGp9XYHK_Ay8qdvmqEc_sXw@mail.gmail.com>
To: Watson Ladd <watsonbladd@gmail.com>
Content-Type: multipart/alternative; boundary="f46d043bdb0eb6dae604f7dfb04d"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/1IgphutUbtoSRQ1w9m_7t1JahBs
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Encrypting ALPN and other unused extensions
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: Fri, 25 Apr 2014 15:34:00 -0000

On Fri, Apr 25, 2014 at 7:53 AM, Watson Ladd <watsonbladd@gmail.com> wrote:

> Dear all,
> Some extensions aren't used by the TLS layer, like ALPN. One of the
> goals is to encrypt them. However, in a zero-RTT handshake this will
> require knowing a server key to encrypt them with. In a one-RTT
> handshake one can do the same thing.
>

I think you mean this, but just for clarity, 0-RTT handshakes generally
assume that the client knows the server's key, since the client is
going to encrypt data to the server in the first flight using that key.


The challenge is the case where the client knows nothing about the
> server: here it cannot be encrypted until after the client hears from
> the server, and since this is a negotiation, another round trip after
> that.
>
> Having the server make the offer and the client accept one fits nicely
> into the 1-RTT handshake with no problems. However, this is not what
> we decided to do with ALPN.
>

It's worth mentioning that this actually entails a delay for the server
in server-speaks-first protocols. I.e., in ALPN as soon as the server
has selected the protocol it can start emitting data, whereas in a
mode where the protocol selection is in the client's second flight,
the server now has to wait for it. Of course, with HTTP, because
the client speaks first, the client can piggyback the protocol
selection message on the first request.



> Any ideas?
>

draft-rescorla-tls13-new-flows-01 explores this a bit.

First, if the client is really totally naive about the server, then if it
wants
to do ALPN it pretty much needs to send the ALPN information in the
clear in the ClientHello, since the server might be TLS 1.2 or below
and this is the time it can send it. However, if the client believes
that the server is likely to be TLS 1.3, then there are some options...


A. If we're attempting to encrypt SNI using an anonymous DH exchange
as in Section 6, then we obviously get passive protection of the ALPN
information for free. It's more work to get active protection, but since
(a) SNI is probably more sensitive than ALPN and (b) the attacker
can generally simulate being TLS 1.2 or below for naive clients,
it's not clear how much that would help in any case.


B. If we're not attempting to encrypt SNI (or we are using something
like Andy's suggestion), then it seems like there are roughly four
options:

1. Only encrypt the server's side of the ALPN negotiation, which
contains the selection but not the client's side which contains
the offer, as in Figure 6 in:
http://tools.ietf.org/html/draft-rescorla-tls13-new-flows-01#appendix-C


2. Allow only clients with previous state to encrypt the ALPN information,
in both 0-RTT and 1-RTT cases, as in Figure 3 in:
http://tools.ietf.org/html/draft-rescorla-tls13-new-flows-01#section-6.1


3. Have some in-band mechanism for the client to discover the server's
keys, though this could be simplified from the flows in
draft-rescorla-tls-new-flows-01, since the client can reveal the SNI
in its first message and just get the server's keys then.

4. Have some out-of-band mechanism for the client to discover
a server key and then encrypt it along with the rest of the ClientHello
(basically what Andy suggested for SNI).


Obviously, you could mix-and-match these to some extent. I.e., one
could allow the client to either send the ALPN information in the clear
if it has no previous state or encrypt it if it did, with DNS being one way
to acquire said state. As Andy pointed out, the handshake state machine
and message flows would be basically the same in both cases, except
that the ClientHello would be encrypted in one and not the other.
The major drawback, of course, is that you have two otherwise
similar appearing modes with different privacy properties.

-Ekr