Re: [TLS] PR for anti-downgrade mechanism

Eric Rescorla <ekr@rtfm.com> Sat, 17 October 2015 21:54 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 69A9A1B2C6C for <tls@ietfa.amsl.com>; Sat, 17 Oct 2015 14:54:40 -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 tZ5xzb3nWVr5 for <tls@ietfa.amsl.com>; Sat, 17 Oct 2015 14:54:38 -0700 (PDT)
Received: from mail-yk0-f181.google.com (mail-yk0-f181.google.com [209.85.160.181]) (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 00F0B1B2C6B for <tls@ietf.org>; Sat, 17 Oct 2015 14:54:38 -0700 (PDT)
Received: by ykaz22 with SMTP id z22so111086317yka.2 for <tls@ietf.org>; Sat, 17 Oct 2015 14:54:37 -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=grRzlBhlQPkQirECkg0wf7Mh3BxwLpY6dQLy3jLYOmE=; b=TBzpRzQXD3bIefNCp9arbNIXI9wQrbzj4Hn1+hwQ1DK8MN0QD7tXEyzwDamgPxMahl +pg8EhlSoMzhYy8cNmLtE/nnGXwWm1KpgNezTtJ/eO0AHMiThLUUueKo2zlceH0PRPKo yXbQEdJ3Yn5ZlhlgSHeYrq4k6iCX0FbQpFqzJSzCo0phUqGZY5p1wOl4RBzU4OCY8ypm PtDCPwiEr1ZakVi6X2JpTSEXjtD1+DgzLO9mqWkqECrLa1fyGjXnc3Y99Mct2gVqwoKg aZE216D1CaL/XGbWfD1ipjq7S/qipgfpCToyAmoh0WF4L6LS2HVy52jMSmcSWpvUOaBx PG4w==
X-Gm-Message-State: ALoCoQmxmKj6YKgExC0NHu6j77dlulaXhqvDU/Jk2fwM6vOmjrN1cANnDlHjRJk807ul8DFQlx3k
X-Received: by 10.129.41.148 with SMTP id p142mr16543974ywp.274.1445118877223; Sat, 17 Oct 2015 14:54:37 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.114.85 with HTTP; Sat, 17 Oct 2015 14:53:57 -0700 (PDT)
In-Reply-To: <201510171734.26589.davemgarrett@gmail.com>
References: <CABcZeBOB9mnQ8bLOCSysnx9LMv0hxrPCA21jTnxAMb3Yom_Aow@mail.gmail.com> <201510171708.16547.davemgarrett@gmail.com> <CABcZeBOzJkdjC-NnjPcHtoU_6rmEMPqj4Y7xKuA=CHZLT9r49w@mail.gmail.com> <201510171734.26589.davemgarrett@gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Sat, 17 Oct 2015 14:53:57 -0700
Message-ID: <CABcZeBNFvUN6KOpzGO5_tPU9dqbJ8q=k_CaqmkjeCR_hS2RCOg@mail.gmail.com>
To: Dave Garrett <davemgarrett@gmail.com>
Content-Type: multipart/alternative; boundary="001a11421e285600fa052253f502"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/iWp8XvmwABBq42LrSp1Za5O-59c>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] PR for anti-downgrade mechanism
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: <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: Sat, 17 Oct 2015 21:54:40 -0000

On Sat, Oct 17, 2015 at 2:34 PM, Dave Garrett <davemgarrett@gmail.com>
wrote:

> On Saturday, October 17, 2015 05:16:49 pm Eric Rescorla wrote:
> > On Sat, Oct 17, 2015 at 2:08 PM, Dave Garrett <davemgarrett@gmail.com>
> > wrote:
> >
> > > On Saturday, October 17, 2015 03:10:18 pm Martin Thomson wrote:
> > > > The observation is still valuable in the sense that prohibiting
> values
> > > > > 1.3 would reduce the likelihood of a false positive by some
> > > > miniscule amount.  In other words, I agree with ekr here, though we
> > > > could cap the value to 1.3.
> > > >
> > > > Maybe we could just define two values: one for TLS 1.3 (and greater,
> > > > presumably) and one for TLS 1.2.  I don't see any value in protecting
> > > > 1.1 or 1.0 from downgrade any more given relative prevalence of those
> > > > protocols and their age.
> > >
> > > Two values seems like a good compromise to me if one isn't considered
> > > sufficient. I don't particularly want them changing in the future so
> old
> > > (e.g. TLS 1.3, in a future with TLS 1.4+) implementations don't need to
> > > worry about seeing something new here and making a mistake. Checks
> would be
> > > for one of two 64-bit values, rather than 56-bit values with a byte
> with a
> > > possibly unknown value
> >
> >
> > My assumption here was that the client would do the following:
> >
> > 1. Look to see if the server negotiated its highest version. If so, then
> > all is good.
> > 2. If the server did not negotiate the highest version, then look for the
> > sentinel.
> >     If it's set, you have a downgrade.
> > 3. (Optional) If you have a downgrade, parse the last byte to see the
> > server's actual version.
> >     In any case, abort.
> >
> > What have I missed?
>
> A 64-bit sentinel can be trivially checked as a 64-bit uint.


And a 56-bit value can be trivially checked by masking off the last byte.
Or, memcmp().


If we have an open-ended series, we could have implementations checking for
> a set of 64-bit integers,rather than a 56-bit followed by another byte to
> be inspected.


As noted, nobody is making you check it.



> I'm being paranoid, yes, but it's simpler just to have a round number bits
> value or two and I don't think you get much by encoding further information.
>
> It also has a slightly better collision risk, though it's already down
> quite low


Given that the TCP checksum has a false negative rate far higher than
2^{-56} and
any TCP errors cause TLS handshake failures, this doesn't seem like much of
an argument.

-Ekr




>
> Dave
>