Re: [TLS] What does it mean to not include 0-RTT message in the handshake hash?

Ilari Liusvaara <ilariliusvaara@welho.com> Fri, 25 December 2015 08:04 UTC

Return-Path: <ilariliusvaara@welho.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 92B381A8989 for <tls@ietfa.amsl.com>; Fri, 25 Dec 2015 00:04:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Level:
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01] 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 JUQn6mYEiLMm for <tls@ietfa.amsl.com>; Fri, 25 Dec 2015 00:04:21 -0800 (PST)
Received: from welho-filter4.welho.com (welho-filter4.welho.com [83.102.41.26]) by ietfa.amsl.com (Postfix) with ESMTP id 436801A8988 for <tls@ietf.org>; Fri, 25 Dec 2015 00:04:20 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by welho-filter4.welho.com (Postfix) with ESMTP id 1E830237B; Fri, 25 Dec 2015 10:04:19 +0200 (EET)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp1.welho.com ([IPv6:::ffff:83.102.41.84]) by localhost (welho-filter4.welho.com [::ffff:83.102.41.26]) (amavisd-new, port 10024) with ESMTP id 4lS2pIH1JaF2; Fri, 25 Dec 2015 10:04:18 +0200 (EET)
Received: from LK-Perkele-V2 (87-92-35-116.bb.dnainternet.fi [87.92.35.116]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by welho-smtp1.welho.com (Postfix) with ESMTPSA id B540D138; Fri, 25 Dec 2015 10:04:18 +0200 (EET)
Date: Fri, 25 Dec 2015 10:04:18 +0200
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: Eric Rescorla <ekr@rtfm.com>
Message-ID: <20151225080417.GA2800@LK-Perkele-V2.elisa-laajakaista.fi>
References: <DM2PR0301MB06555FC15830293E0C4E381AA8E50@DM2PR0301MB0655.namprd03.prod.outlook.com> <201512241701.49373.davemgarrett@gmail.com> <CABcZeBM8i=iMF_9VYfkCOYZ5kso=70S-t4sX-jh+2AgFPf8iGw@mail.gmail.com> <201512241748.25385.davemgarrett@gmail.com> <CABcZeBMDXrCxjp+RtHGsxsZRGjEUJOy8BCxRLu4pMbFXkNcnEA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CABcZeBMDXrCxjp+RtHGsxsZRGjEUJOy8BCxRLu4pMbFXkNcnEA@mail.gmail.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
Sender: ilariliusvaara@welho.com
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/tTUR6goc-qxWMy-9-DsFUZ1bV6Y>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] What does it mean to not include 0-RTT message in the handshake hash?
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: Fri, 25 Dec 2015 08:04:23 -0000

On Thu, Dec 24, 2015 at 08:08:25PM -0500, Eric Rescorla wrote:
> On Thu, Dec 24, 2015 at 5:48 PM, Dave Garrett <davemgarrett@gmail.com>
> wrote:
> >
> > This last bit stops this, yes. I would prefer the spec say this very
> > explicitly, as right now it doesn't and all I see is a line saying:
> > "If any of these checks fail, the server MUST NOT respond with the
> > extension and must discard all the remaining first flight data (thus
> > falling back to 1-RTT)."
> 
> Well, this is a general requirement any time the record MAC is bad:
> See http://tlswg.github.io/tls13-spec/#rfc.section.5.2.2
> "If the decryption fails, a fatal “bad_record_mac” alert MUST be generated."
> 
> > The current text doesn't explicitly say how to handle 0-RTT data that it
> > thinks it should be able to decrypt but can't. After rereading things a bit
> > I think you're correct in that the correct course of action the spec
> > currently expects is to abort, however implementers frequently err on the
> > side of working partially vs not at all when given any wiggle room. A clear
> > hard "MUST abort" on failed decrypt of 0RTT data would deal with this and
> > avoid any other possible misunderstanding. Either do or do not; no try.
> >
> 
> If you have suggested text, I'd be happy to see a PR.

Except that when server is doing 1RTT fallback and skipping 0-RTT data,
then records that get deprotect failure (is that the proper term?) are
ignored instead of generating bad_record_mac like "normal" deprotect
failure would.

Then there's also the case where server is skipping 0-RTT data for retry
(there one can recognize end of data from content-type 23 changing back
to 22).

Then one has to ensure that configuration_id's are never reused: If
client and server disagree about server-valid configuration, the result
can easily be hard failure (instead of fallback).

One server-side trick to ensure non-reuse would be to hash the server
certificate and the configuration messages (with configuration_id being
zeroes of approriate length) using e.g. SHA-256 and then use the resulting
hash as configuration_id.




-Ilari