Re: [TLS] Treatment of (legacy_record_)version field [was Re: (strict) decoding of legacy_record_version?]

Eric Rescorla <ekr@rtfm.com> Wed, 23 November 2016 13:18 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 4C9E3129DB3 for <tls@ietfa.amsl.com>; Wed, 23 Nov 2016 05:18:46 -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 EZXgzcaXvYr5 for <tls@ietfa.amsl.com>; Wed, 23 Nov 2016 05:18:34 -0800 (PST)
Received: from mail-yw0-x231.google.com (mail-yw0-x231.google.com [IPv6:2607:f8b0:4002:c05::231]) (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 ADE3D129BD8 for <tls@ietf.org>; Wed, 23 Nov 2016 05:18:34 -0800 (PST)
Received: by mail-yw0-x231.google.com with SMTP id a10so10798660ywa.3 for <tls@ietf.org>; Wed, 23 Nov 2016 05:18:34 -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=5+FigfvlwK9jPzvJddRIYJwBU2I2lJX+YdJso1e/raw=; b=gWwyTyQVNjjL/3nCGpztawI01Vl1lAgrijNc2h3WXDMupqRl5ro/RLNuMV+KrzhH1A W0EIqqk8pP0a7ORB5deJ4TtNFyopmYsfc98GxFwvzFIyOZ1KhXMzXXKkL2+2prAAZOR8 Y/E/VblLpHEVZwRx7Coq7YGqRYrKCh+1KdAyzmIz2syaTZJltXWiA8Sg3ycS/EOaVtXc QF/pP+9entdBavzbot8lc82t3BTq2HdnjkNk7x7EMVBLA+p3owIPkO8L0PueEtH+CqeH zSWnrMkKBeZMeuHpBk57eX3So3iNxE5TPC9FjvASniZgbIiU32uZRRa2GqXnybgpFGuT argw==
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; bh=5+FigfvlwK9jPzvJddRIYJwBU2I2lJX+YdJso1e/raw=; b=PV3IyTvSj12i+C77pncVO5dKK+wI5k059jrOGocqRWb1zodK0Yemd2LKcbEyW+tqjK SLcEj6WxCQfucABqruyOXVV/Uelilu3UdjGAkYd1WyVKc+Ygkh19MblGOvgazCp9TTx1 xJfNWcZAbA9fuVQ0z1fF02RUgZigiJanOyhF+m0/hhCMaCV1d3n41o6zM2wHolTrL57E 3UonLXf+ZVjhAu2eIUqDW5dz3qYIDJ44lZJDxmAp1eD7jyEr+vUGp2by8YEHyINWmO96 QLdO6qwj8CZlCKopUqGmIbmV6LB2cNwCE9j6is4jVjzoMiiy4Yjy2ewma3ICJcSGYAmd YmSg==
X-Gm-Message-State: AKaTC00rUlo3R5aQbw7r4KrLySBZArZCZsbiCBbTolEdr7w5sQ5weQc39WyYPEe6LfYd6CZkpRP/NwEfn+cAXQ==
X-Received: by 10.13.195.5 with SMTP id f5mr3655665ywd.354.1479907113922; Wed, 23 Nov 2016 05:18:33 -0800 (PST)
MIME-Version: 1.0
Received: by 10.129.159.141 with HTTP; Wed, 23 Nov 2016 05:17:52 -0800 (PST)
In-Reply-To: <58358E07020000AC00121380@gwia2.rz.hs-offenburg.de>
References: <CABcZeBMeLgqjvr2cjWL=AHTQJbS9siNBB6U2=0654yigbBGkYA@mail.gmail.com> <47532130.8rB6yCJVvA@pintsize.usersys.redhat.com> <CABcZeBOsN+_gUUb=HoUsoPOTBgANedT5Y5O+pAGXn0qTYjq1jg@mail.gmail.com> <4268201.z3YH5P6ntS@pintsize.usersys.redhat.com> <CABcZeBMg_QjHQf3b1mJcuDtCH1o2Gpv=YDdDPkAu5GwEhVaCfg@mail.gmail.com> <c83f4ada-f3e7-12f5-aedd-f41ff5e80665@akamai.com> <CAF8qwaC2oRqqHAeWRoGm24ZmDe0YAR6xgoA6NWNx59bV+dAOJw@mail.gmail.com> <CAFewVt7oBausHM9E83nvzOh1DRCB4f4d92t2X8EmN-CzFU41OQ@mail.gmail.com> <CABkgnnXgOJBThg66ZzXSk4vFqL8XKK3w0KGWZci=vWiLXoQ9Hw@mail.gmail.com> <CAFewVt54F6HuNqdGV0ztWvMiOSreqLmaU+VUQD9EPZkGT5=O2A@mail.gmail.com> <CABkgnnXc8MWA7HCPYCDhKXyF1G3ORxd_0yAvN+gWUBcgs5-36g@mail.gmail.com> <79f10997-3bbc-fbce-91ae-2ceecaaa653e@akamai.com> <58358E07020000AC00121380@gwia2.rz.hs-offenburg.de>
From: Eric Rescorla <ekr@rtfm.com>
Date: Wed, 23 Nov 2016 05:17:52 -0800
Message-ID: <CABcZeBNMmdM8YqNc0tOxgoWQFXBZvSopudFTQGkvqV7qkzM6tw@mail.gmail.com>
To: Andreas Walz <andreas.walz@hs-offenburg.de>
Content-Type: multipart/alternative; boundary="001a114d5fd6d3b5d60541f7b9a0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/NrCf0nv7IDIDhCE0BzZ2G1f2WTQ>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Treatment of (legacy_record_)version field [was Re: (strict) decoding of legacy_record_version?]
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.17
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, 23 Nov 2016 13:18:46 -0000

On Wed, Nov 23, 2016 at 3:39 AM, Andreas Walz <andreas.walz@hs-offenburg.de>
wrote:

> Dear all,
>
> bringing up this thread again ....
>
> In the course of studying the way TLS implementations treat the "version"
> (or "legacy_record_version") field in the record header, we were wondering
> (please excuse if we missed some arguments here from past discussions):
>
> (1) What is an implementation (in particular when receiving the first
> bytes over a new connection) supposed to do if the record's version field
> signals a protocol version the implementation does not support? I
> understand that, at this stage, enforcing a specific value (e.g. 0x0301
> according to the TLSv1.3 draft) is detrimental to interoperability.
> However, if that field bears any meaning (in either TLSv1.3 or previous
> versions), what is it? I would expect this field is supposed to allow
> signaling a potentially non-backward compatible record format
> (inauspiciously interfering with a receiver disregarding the record
> version). Provided this field isn't treated as an enum, what about
> checking/enforcing at least the major version as BoringSSL does (as far as
> I know)? In any case, I would propose to be very clear about this in the
> text (my sense was that there is some work in progress, but I couldn't find
> anything). In implementations (<TLSv1.3), we found all kinds of
> interpretations.
>

In general, it should ignore it. It's going to become increasingly common
to have this be a version you don't support given the recommendation to use
0301 and the ongoing deprecation of TLS 1.0. I think it would be fine to
sanity check the major version, but I'm not sure what would be gained by
requiring this.



> (2) What is an implementation (up to TLSv1.2, as the TLSv1.3 spec is
> rather clear about that) supposed to use for the record's protocol version
> field before a version has been agreed upon (e.g. when sending an alert
> after receiving an unparsable ClientHello)? My best guess would be to set
> it to the lowest (TLS) protocol version that uses the same record format
> (probably 0x0301). However, we observe several servers which, in such
> cases, answer with an alert with weird record protocol version values, e.g.
> 0x0000.]
>

Yes, this seems like a reasonable procedure. Not sure how to tell TLS 1.2
impls what to do at this point, though.

-Ekr


>
> Thanks and Cheers,
> Andi
>
> ___________________________________
>
> Andreas Walz
> Research Engineer
> Institute of reliable Embedded Systems and Communication Electronics
> (ivESK)
> Offenburg University of Applied Sciences, 77652 Offenburg, Germany
>
>
>
> >>> Benjamin Kaduk <bkaduk@akamai.com> 11/10/16 5:22 PM >>>
> On 11/08/2016 06:25 PM, Martin Thomson wrote:
>
> On 9 November 2016 at 05:59, Brian Smith <brian@briansmith.org> <brian@briansmith.org> wrote:
>
> This isn't a pervasively shared goal, though. It's good to let the browsers
> police things if they want, but I think a lot of implementations would
> prefer to avoid doing work that isn't necessary for interop or security.
>
> If you permit someone to enforce it, then that is sufficient.  I don't
> think that we should ever force someone to enforce these sorts of
> things (as you say, sometimes strict enforcement isn't cheap or even
> desirable).
>
>
> Agreed.  We should probably change the text a bit, though, as right now
> readers can get two different readings depending on whether they go for a
> strict decode_error (or illegal_parameter?) since the struct doesn't match
> the definition, or follow the "MUST be ignored for all purposes".
>
> -Ben
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>
>