Re: [TLS] Is stateless HelloRetryRequest worthwhile? (was Re: TLS 1.3 Problem?)

Michael D'Errico <mike-list@pobox.com> Fri, 02 October 2020 18:17 UTC

Return-Path: <mike-list@pobox.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 815713A1664 for <tls@ietfa.amsl.com>; Fri, 2 Oct 2020 11:17:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=pobox.com header.b=i99zeJbR; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=i4Uj+NgQ
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 WxL_uMyvrciO for <tls@ietfa.amsl.com>; Fri, 2 Oct 2020 11:17:01 -0700 (PDT)
Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3F2293A1663 for <tls@ietf.org>; Fri, 2 Oct 2020 11:17:00 -0700 (PDT)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 79272C44 for <tls@ietf.org>; Fri, 2 Oct 2020 14:16:59 -0400 (EDT)
Received: from imap21 ([10.202.2.71]) by compute4.internal (MEProxy); Fri, 02 Oct 2020 14:16:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm1; bh=ECrn+kazCmK3jIrKBepPm7AAbJw2J8Z hsJl7tfrZK6k=; b=i99zeJbR93HHfm4TWKLxte6yuYe3hD8iYpw7ZF4SBUFSSd5 3xKv3Pcr+y9yvjYEm5pasW4YUIa8gQlOQBy3hOKZAIBMyFj1d70+B9UtBIpcVchd 1yPULBtggei3ZXHDkm0jbRc7nGhDJWQnZar6AowP+qSOWb7ADc+XyvmEk4Q2MscQ UyM9F4pbQ8vs8D3pwJstWmH1xdO2fW/WptEwLfY3aQmwEj5/WOA61J4KgH+6U6Yt gPx3YXCO1ZZRKjqB6M2vZefNdLsZrsUtw2wsVbrvbyXbUrniAb9nVlgNyMPrt4Ry tC3T/nOm8fJ/PG9WY1TdT8EtNaK5miEH+mPPx3Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ECrn+k azCmK3jIrKBepPm7AAbJw2J8ZhsJl7tfrZK6k=; b=i4Uj+NgQNSwdphv4sTfjYc sUVCuYH9sAhzQWNBBp4+YQbvS9iOwlL79bVWiR+11qdPCLYi46uMKJ5O96onL8jG sWx9rw1JdPFm7r6i4F2gwLIVm6LV+MFoWeJO05rGHQ6N/krlHbFcnDGPBNVD7cEL 94bkTddxcXkltRIAjwxQ/jggGA3pLQ2KXZUC3S2XsJ6jCjj/tBp8MxwqDtKBuqTc 6d+F/N8ClaF0rKgVX0OQHp8Wpy+uSm32be5TWkd8TYjhA8nWCIIZ+hceIdVwMmir JBKCeX3KFTwfDvecNLblbGUBdR+M7ylBVMLUYAzyV9R4q2k0/H+5vT39c/PVaNmQ ==
X-ME-Sender: <xms:mm53X0rnCBmnboZa72haFaVx8jh9aEjijOoSoXfBaNE_3AxfEvTIuA> <xme:mm53X6oSxVRJFYnu_i7sen-WmGKnDIsYPPfRi5Z7IvLJcUcMIBQ0MbBxtia4CJ7DU n_dW4wYOMr-HBGFYA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrfeeigdduvddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsehttd ertderreejnecuhfhrohhmpedfofhitghhrggvlhcuffdkgfhrrhhitghofdcuoehmihhk vgdqlhhishhtsehpohgsohigrdgtohhmqeenucggtffrrghtthgvrhhnpeeludetffeivd ehgeeltdehleffkeelfedtheelkeeghefhffekgeelkeekudekueenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihhkvgdqlhhishhtsehpoh gsohigrdgtohhm
X-ME-Proxy: <xmx:mm53X5MGxr4_-bt5FENx7OL9ppXpPyjskQScQGasQWeiyPXdbasxQg> <xmx:mm53X75KoPIEmHlZpgyllT2MHsKXYzQ4Nm3mw2ONnyfkA9TzbcNfSg> <xmx:mm53Xz5L0jj6jx1g93ASfqVA-_gAMnxYkKNFLXP0I16AKe4iUYVdPw> <xmx:m253X1Exz7EuaHbgR_xA-T1etps9WkXAeRdKw1hwfMjG96L8T8UCUA>
Received: by mailuser.nyi.internal (Postfix, from userid 501) id 92A67660069; Fri, 2 Oct 2020 14:16:50 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
User-Agent: Cyrus-JMAP/3.3.0-382-ge235179-fm-20200928.002-ge2351794
Mime-Version: 1.0
Message-Id: <a574e534-235e-4202-9046-fb5cd18cce7c@www.fastmail.com>
In-Reply-To: <CACdeXiKo37pUc9J+wMaM8119uMAUCqURRk+2qyGJi_v49twSCg@mail.gmail.com>
References: <0c31f2d6-5f8e-2fd6-9a1a-08b7902dd135@pobox.com> <AM0PR08MB37164F2D0E0CE5FB6D62D461FA350@AM0PR08MB3716.eurprd08.prod.outlook.com> <1c7e2f31-8a9e-4bd8-9e80-ab18ebeb609f@www.fastmail.com> <CACsn0cmbDz3ML8o5moAacqfXqYQo-Hqi53XQL6UoGYcZBwy-Mg@mail.gmail.com> <96777977-7707-4311-9876-ca3d53f57f3e@www.fastmail.com> <9b2bb784-5895-bc8a-fae5-1c2056972f97@pobox.com> <eaace566-4fe2-4e86-8382-e0583ce43435@www.fastmail.com> <24f5cd7e-4fff-ce47-f9d9-840dff3f23aa@pobox.com> <3b48fa2d-f923-40ee-a93f-e0896a96fc1b@www.fastmail.com> <ba70c2ba-9023-4cc8-974a-01a64a60de2d@www.fastmail.com> <82488341-a4c6-2ed9-d8e2-6479151a5f90@pobox.com> <03ba01d6974e$ffaefe30$ff0cfa90$@gmx.net> <76c30176-f3bf-cc8f-74fb-b875d66e636f@pobox.com> <ABC80E3E-4C18-4290-B13E-50EDC129566B@akamai.com> <bc6251b7-681f-407a-9e30-dc2a430edeaa@www.fastmail.com> <CAChr6Sy_UG2Z1sOvvQSOetkJ5HGUea2SaSAN+kEJu4X-5MeQJg@mail.gmail.com> <2d9ee8e6-892b-4070-8e87-4902e53a5f70@www.fastmail.com> <CACdeXiKo37pUc9J+wMaM8119uMAUCqURRk+2qyGJi_v49twSCg@mail.gmail.com>
Date: Fri, 02 Oct 2020 14:15:48 -0400
From: "Michael D'Errico" <mike-list@pobox.com>
To: tls@ietf.org
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/Ag0N7aPvqxQYo2zBGvjrK2UwlCI>
Subject: Re: [TLS] =?utf-8?q?Is_stateless_HelloRetryRequest_worthwhile=3F_=28?= =?utf-8?q?was_Re=3A_TLS_1=2E3_Problem=3F=29?=
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
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, 02 Oct 2020 18:17:03 -0000

> > You can't possibly implement [stateless HelloRetryRequest] the
> > way the spec suggests with just a hash in a HRR cookie extension. 
> 
> The only thing the server needs to know is the hash of the ClientHello 
> (so it can restore the transcript hash) and that the server has already 
> sent a HelloRetryRequest (which it can detect by presence of the 
> cookie). The only argument I've seen made for what the spec suggests 
> not working is being able to verify which fields changed between 
> ClientHello1 and ClientHello2.

The server also needs to know the entire HelloRetryRequest message
since this goes into the Transcript Hash calculation:

  Transcript-Hash(ClientHello1, HelloRetryRequest, ... Mn) =
      Hash(message_hash ||        /* Handshake type */
           00 00 Hash.length  ||  /* Handshake message length (bytes) */
           Hash(ClientHello1) ||  /* Hash of ClientHello1 */
           HelloRetryRequest  || ... || Mn)

Many of the fields in HelloRetryRequest are fixed or predictable, but
the legacy_session_id_echo is not, for example.  Also, relying on the
client to remind you what the hash of ClientHello1 is seems extremely
"optimistic" (in my opinion).

> I see no language in RFC 8446 that the server MUST enforce that
> the ClientHello2 is conformant with respect to  ClientHello1.

It doesn't, and you could probably argue that the HelloRetryRequest
can be just a "do over" and let the client try again however it wants.

But if the server doesn't do 100% validation of the second ClientHello
as if it never received the first one, then there is room for mischief by
a "curious" client.

Mike