Re: [TLS] DTLS 1.3 AEAD additional data

Eric Rescorla <ekr@rtfm.com> Thu, 23 April 2020 21: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 F0E813A13F8 for <tls@ietfa.amsl.com>; Thu, 23 Apr 2020 14:18:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_NONE=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=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 utOXlEbzwKqQ for <tls@ietfa.amsl.com>; Thu, 23 Apr 2020 14:18:29 -0700 (PDT)
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) (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 9E5F43A1412 for <tls@ietf.org>; Thu, 23 Apr 2020 14:18:28 -0700 (PDT)
Received: by mail-lf1-x132.google.com with SMTP id 131so5918227lfh.11 for <tls@ietf.org>; Thu, 23 Apr 2020 14:18:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=H01mJDs0IzDLhjsBbrk0wPdqJ90Aj2vglMgqPppWNcE=; b=pFFQaFNlkmacAOi8hM1Ri3pDv+VndDuiHWnf4MHD0T/DsU2O7vmK+CdiJ2i1RXbWHD sEnzBSkHK+RGLX8Z7cGa6ErbYScjFg2X+9ZKpU/R+yHrzIs8mEkIWv0keJLgy5q05wIP wUnQw9GHPe7jroeycobz/hUEep4rhKqMmrBUQUXKPt+oRYzACpMq+SGouF8MNCiBeMOf UoCJ9+9fzSCY1iONuXMuEfJR0K1BpFyUz3WFEviMEXnfHUAVD7Q6/GAhetHdydZWTj3/ z7Bux8x/jlqPf6qhLmXyh79Ruh/LPDf0ouCYG8RWGMLLxEoocCmUEKRRwHGtkylJ6mk8 WHkA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=H01mJDs0IzDLhjsBbrk0wPdqJ90Aj2vglMgqPppWNcE=; b=ZwgwYIGMHTKAb5JnO5MRxrTudzJ0OK47ifhHRV6k5IBU33VZgTAHGo/Aa/m2qIan6v odOs1MrSRypYXEftUusM7uA5i2ORJdvoEn799PhuxJ84CdJg3x14teOKf4jMT3qAEhCu +cfdDMQ0yWaJzKbX2T2cxZYhP/VuqMKwTOEPh+ySAHSe6IfAO2MzNPKTeWdBA8OdYRAC nv56EYRt+4PNb4EAjQ2E0iCrUBbZlhR/joJ7IC2F+PRq73LX6BkvinM9phQPUjTwpZUK 37NvmCXQfiAzXaByik78h4e5N2dSWrZH25Hn5+hMJDZOCpuBavc6t/zgEyTpoETOtjL0 WwXg==
X-Gm-Message-State: AGi0PuZlf6RuTdYaf5x12ATFa4f64dZtqUr+1eSGVTtnebH68u3omUbS SZnXOLhwm4dnF3nVY91SS4LXxk/ZNhdErPN5FJXLAM9aUhM=
X-Google-Smtp-Source: APiQypIuzrB0co0MQp8py8o20AH+X28R4pWNpnA0RHSoLGofZ6j00J/ADx4Mx8kurDvYiu/dFnYvz37Wk6/+6Lh9lRQ=
X-Received: by 2002:a19:f806:: with SMTP id a6mr3688430lff.201.1587676706755; Thu, 23 Apr 2020 14:18:26 -0700 (PDT)
MIME-Version: 1.0
References: <AM6PR08MB3318911C71C0DDB90480694A9BD50@AM6PR08MB3318.eurprd08.prod.outlook.com> <CABcZeBMs+o4BU5VhqJKmQvnkEe9RkQXRv7Ej6pVD1-e1vdMoyA@mail.gmail.com> <CABcZeBM9Ri=Rz5kbWn08Vk-Y14MVSALwB1Bd9QV=HfWoq3XqSA@mail.gmail.com> <AM6PR08MB33184161239B6383EA7D776C9BD20@AM6PR08MB3318.eurprd08.prod.outlook.com> <CABcZeBM4wVkH_pdTZMakyV9Y=tk8PNDknHTFhjwX-sw3GOOaZw@mail.gmail.com> <AM6PR08MB3318D6A11587449627F6EA679BD20@AM6PR08MB3318.eurprd08.prod.outlook.com> <CABcZeBNcODKehe217nr2jSedy6N6Gun+QYcksFp2Oqv6gLrzzw@mail.gmail.com> <AM6PR08MB3318717D21E69A2373AC1ACE9BD20@AM6PR08MB3318.eurprd08.prod.outlook.com> <8371994b-799c-4196-a3cd-4b0f71e24b5e@www.fastmail.com> <CABcZeBNbehkW8FO29DS00m19+b=dH8V8esscu8OU-mmaJf6etQ@mail.gmail.com> <5b74a840-a1cd-4b5b-a0c5-65320b851325@www.fastmail.com> <CABcZeBOvm-nx6hKR79ChN=A4RFzWgt=-BzjORc=N7_A79tO6Ng@mail.gmail.com> <AM6PR08MB3318D5881B8D2BEFF938F2B79BD30@AM6PR08MB3318.eurprd08.prod.outlook.com> <1e6201d6-a078-4137-898d-d1554c22aa10@www.fastmail.com>
In-Reply-To: <1e6201d6-a078-4137-898d-d1554c22aa10@www.fastmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Thu, 23 Apr 2020 14:17:50 -0700
Message-ID: <CABcZeBPs7gOenD8Fs2uFXxY=hHyvwiKAvqkDPNzSZDTuReuBJg@mail.gmail.com>
To: Martin Thomson <mt@lowentropy.net>
Cc: Hanno Becker <Hanno.Becker@arm.com>, "<tls@ietf.org>" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000001fea0905a3fbca3a"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/iO64DWktqY8vGC-pPEn9O9e4FIM>
Subject: Re: [TLS] DTLS 1.3 AEAD additional data
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: Thu, 23 Apr 2020 21:18:38 -0000

On Thu, Apr 23, 2020 at 12:40 AM Martin Thomson <mt@lowentropy.net> wrote:

> On Thu, Apr 23, 2020, at 11:49, Eric Rescorla wrote:
> > OK but we would expect the peer to process CID-less records if they are
> > coalesced?
>
> I guess so.  If we allowed them to drop them, then we're close to saying
> MUST NOT omit.
>

Yeah, I would make three points

1. Allowing implicit CIDs is very recent (it was introduced in -34)
2. The CID specification explicitly prohibits it for DTLS 1.2.
3. I haven't really heard a very compelling argument for this and I note
that QUIC forbids it [and in fact has much worse problems when you mix
epochs because the long header is so long]

So, given that the simplest and most consistent thing is to simply forbid
it: can someone make an argument for why this is important to permit?

-Ekr


> On Thu, Apr 23, 2020, at 16:43, Hanno Becker wrote:
> >  > But Hanno's proposal is a terrible thing to have to implement. You
> > have to assume that there is some way to recover which CID to use in
> > decrypting any record. You might save some datagram-local state, but
> > that's awkward. Stacks that I've worked on try very hard not to have
> > state transmission between records for good reasons. So this would be a
> > fairly bad complication. Separately, I hope that no one would be
> > contemplating trial decryption for this, which would be terrible.
> >
> > Yes that's a fair point and also applies to Ekr's proposal
> > https://github.com/tlswg/dtls13-spec/pull/143.
>
> I don't see how.  If you are talking about marshaling costs, that's a
> constant problem, but we haven't found that to be an issue in practice.
> From my perspective, it's the old DTLS records with a pseudo-header that
> are hard to construct; the new format is far easier to construct for
> sending (assuming that you don't try to shave the sequence number length
> down dynamically, but that's a new option our stack doesn't try to use).
>
> Yours is a sending-side concern, and that seems to be subjective, because
> I think that sending is easier without a pseudo-header.  My concerns were
> about receiving.
>
> > The CID maintenance for incoming records can be avoided when forbidding
> > CID elision, as suggested by Ekr.
> > Comparing the state maintenance complications this avoids to the
> > increase in header size it introduces, maybe
> > that's the way to go, as the state maintenance indeed seems to be the
> > bigger pain.
> > However, even if CID elision is removed, I maintain the proposal to
> > always use the logical presentation of the header
> > for AAD, for all the mentioned reasons: (a) No interleaving of record
> > and datagram layer, (b) conceptual clarity and
> > independence of [header] compression methods from cryptographic
> > computations, as e.g. in cTLS, (c) dynamic
> > choice of header depending on network paths. All those issues persist
> > when sticking to the on-the-wire AAD.
> > What are your reservations towards this?
>
> I'm sorry, I don't follow your argument.
>
> The authenticated logical header being different than what is sent on the
> wire is a bug in my opinion.  Authenticating all the bytes you send makes
> the protocol simpler and less error prone.
>