Re: [TLS] Interaction between cookies and middlebox compat mode

Eric Rescorla <ekr@rtfm.com> Thu, 28 December 2017 17:56 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5928D12D964 for <tls@ietfa.amsl.com>; Thu, 28 Dec 2017 09:56:02 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.com
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 fXTzwdVCE0dG for <tls@ietfa.amsl.com>; Thu, 28 Dec 2017 09:56:00 -0800 (PST)
Received: from mail-yw0-x22d.google.com (mail-yw0-x22d.google.com [IPv6:2607:f8b0:4002:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 378A712D962 for <tls@ietf.org>; Thu, 28 Dec 2017 09:56:00 -0800 (PST)
Received: by mail-yw0-x22d.google.com with SMTP id n25so8727398ywh.10 for <tls@ietf.org>; Thu, 28 Dec 2017 09:56:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HbLujKEJk4Sym7Zlmy2vKNi2fEk2qLN27RHfCLaWPos=; b=aX5zRWtPfH1ooVamqu1IS7KJt17jxmjNuL8AZW/LBoq6zezXIfUgwbMf7UyDPvRk4S inh0T/EmPTPXlnce/VKd6QCXLfbEFd5Lre1/LwtfHqdLLOOWfCEFzBokJwReocf1UEjH zhwWSNYQwAdMjM+PjAA4uLaEox8gM4HqN+rvUuw8TH11sCOXvR1X3OwVwaqXoJcZgT0U +FHSqcjAUHIJwjWVKM2FDmL5fx1FSGZaORGrDQEcy3f/L+6EW6EmZpNxsuSkbdt0ISOl imaOHVnulRlyJtBu8wPrsID8VadtbAEk3ONz6zyqx1lZw4q51dLceK6ataoNIv/1BNgW uxlw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HbLujKEJk4Sym7Zlmy2vKNi2fEk2qLN27RHfCLaWPos=; b=CQUnC1RHGVQNTQ1t+TWK9v0FgIfEkRa79LxwGRYludePJgVK/nyCFZebisYdPyp+0V pTOP3vm269VKfYBq3/VkC8jG0RTbx3PADCVnKFI58AbqLF7ZhiQWiGTsIzHndLr5AIpG Y6BIFyDULz4bkqPYx9Bj5WVhB+GyImesClA+iX1lHD0E8Ix2m5i/kVBZ+oSAJct3rV1n LOzmZnkBpexyTUWlTFHVWtPiPyY7LCmCvY6MhQaX4+Kekxb6uvxsrwqlj2eJBWlSDMsn rQt1IDy0izqGNuoslHRtvF8YPtKYi5ODwH40NSg7vsNSV8M3B3CG9ueno2kOrrnP2VdE 4aCg==
X-Gm-Message-State: AKGB3mL7CrL7+9qd4Ct4YS192bneC9tt76nKlQE93eYtYzaLhbsr4KSi dCg+E/m2dTwHD4pW0JVCl5ZGvYFtB26Up7RF/BjnPQ==
X-Google-Smtp-Source: ACJfBosGfLNtE+UXJoAkmy5mW5racOfrV+2kDxzSMeb0ffqB0bjjS3Mb+Mi3HWYjNMKgP8QX3hxcs3xiWFJEX6GmBcQ=
X-Received: by 10.129.85.198 with SMTP id j189mr21738710ywb.504.1514483759299; Thu, 28 Dec 2017 09:55:59 -0800 (PST)
MIME-Version: 1.0
Received: by 10.129.123.132 with HTTP; Thu, 28 Dec 2017 09:55:18 -0800 (PST)
In-Reply-To: <a4822dc1-85c8-c4e1-f757-04786ad9fbbb@openssl.org>
References: <9a7b1178-f856-ec63-c4b7-e2b29993e133@openssl.org> <CABcZeBMS9TeR-kFem4xHiWGVyKn5LbvDomdzL6vV_3XrKkravQ@mail.gmail.com> <37a087f4-efbe-7eae-5539-d220ff67e243@openssl.org> <CABcZeBOfcKTDnc+FcTPutMazSEhg3V8_tWqzeqpv=N6ki9jN9g@mail.gmail.com> <4c37d15e-7375-d4d0-62d1-c6d295fb7080@openssl.org> <CABcZeBNii93boJJBKehxiHa8DZng4FyRZXhu0qD-jx_snzFdvA@mail.gmail.com> <a4822dc1-85c8-c4e1-f757-04786ad9fbbb@openssl.org>
From: Eric Rescorla <ekr@rtfm.com>
Date: Thu, 28 Dec 2017 09:55:18 -0800
Message-ID: <CABcZeBOtCJb538RXrZkHMgV5Q63mYAhrULNPepbGADgDjer50g@mail.gmail.com>
To: Matt Caswell <matt@openssl.org>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="001a113f169e7ddc4a05616a3a82"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/bYpyGBFTY_ZzeGctQFT4gbmUiIA>
Subject: Re: [TLS] Interaction between cookies and middlebox compat mode
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
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: <https://mailarchive.ietf.org/arch/browse/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: Thu, 28 Dec 2017 17:56:02 -0000

On Thu, Dec 28, 2017 at 9:51 AM, Matt Caswell <matt@openssl.org> wrote:

>
>
> On 28/12/17 17:42, Eric Rescorla wrote:
> >
> >
> > On Thu, Dec 28, 2017 at 8:12 AM, Matt Caswell <matt@openssl.org
> > <mailto:matt@openssl.org>> wrote:
> >
> >
> >
> >     On 28/12/17 12:28, Eric Rescorla wrote:
> >     >     I think it would be helpful
> >     >     to be more explicit in the text if that is the case, i.e.
> identify the
> >     >     first point in the handshake and the last point in the
> handshake where
> >     >     CCS is valid. There probably should also be some words about
> how servers
> >     >     implementing older TLS versions should handle a CCS that comes
> first.
> >     >
> >     >
> >     > I could add those.
> >     >
> >     >
> >     >     However, I'm concerned about the added complexity of
> interpreting things
> >     >     that way. Suddenly a CCS arriving is no longer handled by just
> dropping
> >     >     it and forgetting it - you now have to store state about that
> and
> >     >     remember it later on in the process in other TLS versions. The
> CCS
> >     >     workaround was supposed to be a simple no-op to implement and
> it no
> >     >     longer appears that way in this interpretation.
> >     >
> >     >
> >     > Well, it seems like the issue here is you want the client to send
> CH1,
> >     > CCS, CH2
> >     > so we need the server to accept that. Am I missing something?
> >
> >     The point is a stateless server will not know about CH1 at the point
> >     that it receives CCS.
> >
> >
> > Well, sort of.
> >
> > Specifically, there are three valid things that a server (whether
> stateless
> > or stateful) can receive:
> >
> > - CH1 [I.e. a CH without a cookie]
> > - CH2 [i.e., a CH with a cookie]
> > - CCS
> >
> > It should respond to any other message with an alert and abort the
> > handshake.
> > A stateful server should also tear down the transport connection, so
> > that subsequent
> > messages are considered an error. This obviously isn't an option for a
> > stateless server,
> > so, yes, a stateless server might in principle receive arbitrary amounts
> > of junk
> > before CH1 or between CH1 and CH2, and it would still survive, albeit by
> > sending alerts.
> >
> >
> >
> >     Actually, as Ilari points out, there could be any
> >     junk (including partial records) arriving between CH1 and CH2. So
> this
> >     feels more like a special case for stateless servers.
> >
> >     In other words I would prefer to say that a CCS that arrives first is
> >     not allowed. That simplifies the general case and requires no special
> >     coding for servers implementing older versions of TLS.
> >
> >
> > This issue only seems to arise for people who are both doing TLS 1.3 and
> > TLS 1.2 *and* doing stateless implementations, which is kind of an odd
> > configuration because a number of the conditions in TLS 1.3 that involve
> > HRR (and thus can be stateless). It doesn't arise for QUIC (because no
> > TLS 1.2) and mostly doesn't arise for DTLS (if you reject all kinds of
> > junk).  Or am I wrong?
>
> Correct, although technically the wording of draft-22 (in your
> interpretation) *requires* that a server receiving a CCS first MUST
> ignore it - even though that should never happen except in the weird
> scenario above. That is why I prefer to say that a CCS arriving first is
> always an error for the general case.
>

Well, you can receive a CCS first any time you're stateless. What's unusual
is having to subsequently reject it if you are stateless and *then*
negotiate
1.2. My point is that this doesn't seem like a very big hardship for the
reasons
above.

-Ekr



> Matt
>
>