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

Eric Rescorla <ekr@rtfm.com> Wed, 27 December 2017 19:34 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 033FF1275FD for <tls@ietfa.amsl.com>; Wed, 27 Dec 2017 11:34:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 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] 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 dTx_CyG0wL01 for <tls@ietfa.amsl.com>; Wed, 27 Dec 2017 11:34:15 -0800 (PST)
Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (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 26CEF1275AB for <tls@ietf.org>; Wed, 27 Dec 2017 11:34:15 -0800 (PST)
Received: by mail-yw0-x232.google.com with SMTP id q26so7851826ywa.6 for <tls@ietf.org>; Wed, 27 Dec 2017 11:34:15 -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=SvW8Ey6rl90X7r6QnsW+gbDYn53SRJU2skfX/xlxyOM=; b=gU0YMrQU8QliDCCXW+tdgjlPQCSRiHZIvwyPnNSZT+t+BgIK6P0DdGBfQYtdoVvMaE v2zIIfa92P2kufVsX5NeaX489MufUJSqekct2f0bCT1CrYHwOrPmIqWYElR7KwHF504i Rbpo082r8pJ/06BDxazdv20m3W/xC3ysTpuAtyeRpS00xENUk9siAt7DibGm88ZfXEZP t4k8WHha0QN4V3AQNoypbNXHLWZ+OVyeL6D5bmQFYainD7j7qo1EH/nswyvOwRGLEYYW zGRjlBJFoA1EgU/Wioj+U4SdWBFq+0ygh0MxW0rFa6fszlUUUHcQWdEO73c/wcfTKxso xVpw==
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=SvW8Ey6rl90X7r6QnsW+gbDYn53SRJU2skfX/xlxyOM=; b=KAWrsGSkDVMPtbRQnPHuFZeA2Bght9ibdoUF0vx6i5QAt2EcTVYabZ2kLJ40jrLObf GQgEGcuqdkKYPZvX1oAnEC3FZPoKijZIuksNWj9pjnnOP6osH0zO1k8UD8PxgsRPhhBC 8j5ogDtWjtp+XA2LT7b8/Xj/Gm+nZPIVe8yyj/lk9cjAQxtLYNks5nf7KpXuzAvSBHQH MMUskHdLgLdFuiODRdz999G+z0WQ1VWdjUP4hNRXyOquFrJG17Atl4QfK4lNKXbQJA/I jILmHEZvSH8UujvhQWD9RNU2fwW9YO2bmugw+cKfp6cjtv8gG+n91EhgnoYQoeiYtgf8 kkHw==
X-Gm-Message-State: AKGB3mKa7k7D7QLX5mGgetQUJeih2SsS5ODYYGscP9SUvLuFMC1osFZ8 U0lXndcgVLnvw2r0cm5fO5AYbkLi5PcGPT3N89FgxUpD
X-Google-Smtp-Source: ACJfBovptMNWzasyyem9Py/o25v+yb1fbdCZfilWMU4mT+wRoiRd/EZI9IngrwbjWPMyhNna4Hdhm1d6SKO6TfTTaHg=
X-Received: by 10.129.85.198 with SMTP id j189mr19819633ywb.504.1514403254283; Wed, 27 Dec 2017 11:34:14 -0800 (PST)
MIME-Version: 1.0
Received: by 10.129.123.132 with HTTP; Wed, 27 Dec 2017 11:33:33 -0800 (PST)
In-Reply-To: <9a7b1178-f856-ec63-c4b7-e2b29993e133@openssl.org>
References: <9a7b1178-f856-ec63-c4b7-e2b29993e133@openssl.org>
From: Eric Rescorla <ekr@rtfm.com>
Date: Wed, 27 Dec 2017 11:33:33 -0800
Message-ID: <CABcZeBMS9TeR-kFem4xHiWGVyKn5LbvDomdzL6vV_3XrKkravQ@mail.gmail.com>
To: Matt Caswell <matt@openssl.org>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="001a113f169e04c2390561577cff"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/hGD9yuAw-vX_kIvWIVnehp54uSI>
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: Wed, 27 Dec 2017 19:34:17 -0000

On Wed, Dec 27, 2017 at 11:17 AM, Matt Caswell <matt@openssl.org> wrote:

> Consider the scenario where a server is operating statelessly (i.e.
> using the cookie extension) and a client is operating in middlebox
> compat mode.
>
> In that case the client sends an initial ClientHello and receives a
> ServerHello(HRR) back with a cookie in it. Before it sends its second
> ClientHello it first sends a dummy CCS.
>
> >From the server perspective it is operating statelessly so until it gets
> a ClientHello with a valid cookie in it, any message it receives is
> considered the "first" one. Therefore, because the server has forgotten
> about the initial interaction with the client, the first message it sees
> is a CCS.
>
> Draft-22 says this:
>
>   "An implementation may receive an unencrypted record of type
>    change_cipher_spec consisting of the single byte value 0x01 at any
>    time during the handshake and MUST simply drop it without further
>    processing."
>
> Does "any time during the handshake" include the very first message it
> receives? If so then this has implications for servers that accept
> connections from TLSv1.2 (and below) clients (regardless of whether the
> server is stateless or not), i.e. an incoming connection that starts
> with a CCS and then goes on to negotiate TLSv1.2 would be accepted which
> seems odd.
>
> If it doesn't mean that then a stateless server will receive a CCS as
> the first message and not know how to handle it.
>


The way that NSS handles this is to remember that the CCS was received
and then if it turns out that you negotiate TLS 1.2, you throw an error in
that case. With that said, in most of the cases where you are stateless,
you're probably going to want to ignore bogus records anyway, which would
include unexpected CCS.

-Ekr



Maybe there are different rules for handling CCS for stateless servers?

Or perhaps middlebox compat mode should never be used in a scenario
> where a stateless server is being used (e.g. QUIC). Either way it seems
> that some clarification of the wording would help.
>


> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>