Re: [TLS] Choice of Additional Data Computation

Eric Rescorla <ekr@rtfm.com> Fri, 24 April 2020 18:33 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 AAA1B3A0363 for <tls@ietfa.amsl.com>; Fri, 24 Apr 2020 11:33:14 -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 tOyYtOqouqV5 for <tls@ietfa.amsl.com>; Fri, 24 Apr 2020 11:33:12 -0700 (PDT)
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) (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 A94C03A0366 for <tls@ietf.org>; Fri, 24 Apr 2020 11:32:54 -0700 (PDT)
Received: by mail-lj1-x232.google.com with SMTP id u6so10967337ljl.6 for <tls@ietf.org>; Fri, 24 Apr 2020 11:32:54 -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=nuIlJ8CRYAU5TlckQSl2aKOwwJcY/35FTQ7Xwsz3tfU=; b=U0Ocyf9gPmOEDRgEUv2FAetU/M52gVhVIaDiQ4jDtmed1xb7KM6oVq/6G8A654ohza IcdEl7q2h/NZ1GtJ5uXM/o43LKVQSC6q1une89ZWsiTogtUhrvY5NyZ/FmZk2ScoJDQv xj8m9VOns8Klqc4MlMWhH2XSyY21wQ3B7EYYf11RPhnvCizHewMuAZt4H4dEAR+l5ODU /n4EB50nU/v/j7i0VcRacWpMZ0WGYquPsEpj+J2R38ZXXf+fY3bIq2vp4u/vXSSBE4+1 BhtzwY34RbG2JvFvnVRvRQaadYVYiLVMalmHcVGMRcVnxKjClyE7lXk58ZIhAqAmUks7 mHoA==
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=nuIlJ8CRYAU5TlckQSl2aKOwwJcY/35FTQ7Xwsz3tfU=; b=md0tC3SVwou6v8SviuswKhRmryDdZXKEn4zbRXlT0JVkt1QDrdFBHt3rjI24Bzqafi cxkw4Gjv5Jg2UHdoBLOU3PIL0FaYkeeSYz+NCHrX/DghvXWgWS24YGgC+GuOZINRoQaX dtJyyCNb04env9QIM1sCJWMohaoPjN837svteWhg5ksOLYpBxq8kf7ZXVM5E/sjtacT7 ajj/RrgeBHmRKhNLGaOoQS7ywLkAvPPNgqQWaeD2SwZsU37uvP8bb+gtwYbEhpDHlv2U TgRq+oNVeVHvXQE5tq8Pk/Y+u/NFl9SoxDoLHVjzlyheKs/BvF/p2sB1+HCzhULK4h51 nzhw==
X-Gm-Message-State: AGi0PuZUPAOkWj88Ith7fHjupv9kOFLysvw+3B+79ALVZBieMwfvjHc6 Vu7eDdyHjNI/wR23AXxeDOkrKEHVU6Qn6im7mX3X1g==
X-Google-Smtp-Source: APiQypLs8r7cNeUQByyHM2wYOUVeNoTiWsL9acb9GX9koXW8Tl045XcotTwvI13EMNrbHAAZ1Q3pq3g3V3/4Qg8jOdI=
X-Received: by 2002:a2e:9dcd:: with SMTP id x13mr6377735ljj.120.1587753172776; Fri, 24 Apr 2020 11:32:52 -0700 (PDT)
MIME-Version: 1.0
References: <AM0PR08MB371694E826FA10D25F2BA53EFAD00@AM0PR08MB3716.eurprd08.prod.outlook.com> <93042b37-37e1-5b6a-3578-a750054d0507@gmx.net> <AM0PR08MB3716541F4825F8D43DC3D308FAD00@AM0PR08MB3716.eurprd08.prod.outlook.com> <CACLV2m4-Qcx-xKWP201VCY73HVyjCzHVCb6PrntnBWhA8fBQYg@mail.gmail.com> <AM6PR08MB3318B6ABD411C8C476C3D10B9BD00@AM6PR08MB3318.eurprd08.prod.outlook.com> <CABcZeBOwK7m465LsbY3U+bHv0XA2rcGOTEBStTtTNkwAYvWeQA@mail.gmail.com> <CACLV2m5Md2+Ffc978ZJ+BeZwRgcXTV3xE0vXzmvNgnot_c71xQ@mail.gmail.com> <AM6PR08MB331862B6F143652F4B4C10EE9BD00@AM6PR08MB3318.eurprd08.prod.outlook.com>
In-Reply-To: <AM6PR08MB331862B6F143652F4B4C10EE9BD00@AM6PR08MB3318.eurprd08.prod.outlook.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Fri, 24 Apr 2020 11:32:16 -0700
Message-ID: <CABcZeBMKoVrcN-=aTvy6py5bhOwOVrhgVLmtX2tthc=Oa54b_Q@mail.gmail.com>
To: Hanno Becker <Hanno.Becker@arm.com>
Cc: chris - <chrispatton@gmail.com>, Hannes Tschofenig <Hannes.Tschofenig@arm.com>, "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000dad93405a40d97a3"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/QNXtS6rso_gSbCpHWmJxvun4wyM>
Subject: Re: [TLS] Choice of Additional Data Computation
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, 24 Apr 2020 18:33:15 -0000

On Fri, Apr 24, 2020 at 11:17 AM Hanno Becker <Hanno.Becker@arm.com> wrote:

> Hi Chris and Ekr,
>
> > I'm not sure if it's straightforward, but I would note that in TLS 1.3,
> we did *implicitly* authenticate the length because AEAD provides that, but
> nevertheless one of Chris's recommendations was to include it in the AAD.
>
> I don't know if this recommendation still holds for DTLS (though Chris'
> last reply sounds
> like it), but DTLS 1.3 currently deviates from it: The length is
> explicitly authenticated only
> for records using header formats which contain the length, while for the
> most compressed header
> form omitting the length one relies on implicit length authentication via
> AEAD.
>

Yes, that's correct. But you can't swap header formats.


> In the case of TLS 1.3, authenticating the entire header (including the
> length, opaque type, and legacy record version) allowed us to effectively
> ignore most of the header details in the security proof [1]:
>
> If the security analysis shall be agnostic of header details, then in the
> case of
> DTLS 1.3 with its various header formats (
> https://tools.ietf.org/html/draft-ietf-tls-dtls13-37#section-4),
> it sounds to me as if using a pseudo-header containing all header
> information for AAD would fit better (?).
>

I don't think that's at all obvious. Again, the problem with the
pseudo-header is you are authenticating some abstract information, *not*
what is actually on the wire, and that allows the attacker to manipulate
what's on the wire undetected. We have no analysis for the impact of that.


-Ekr


> Best,
> Hanno
>
> ------------------------------
> *From:* chris - <chrispatton@gmail.com>
> *Sent:* Friday, April 24, 2020 6:57 PM
> *To:* Eric Rescorla <ekr@rtfm.com>
> *Cc:* Hanno Becker <Hanno.Becker@arm.com>; Hannes Tschofenig <
> Hannes.Tschofenig@arm.com>; tls@ietf.org <tls@ietf.org>
> *Subject:* Re: [TLS] Choice of Additional Data Computation
>
>
> It doesn't seem straightforward to extrapolate from that case since the
> 'pseudo-header'
> and on-the-wire header are the same here, as TLS 1.3 doesn't have any
> header
> data which is shortened or omitted on the wire. In DTLS 1.3, in contrast,
> various
> fields can be dropped or shortened, such as the length, sequence number,
> CID.
>
>
> It's certainly true that we can't extrapolate the security of DTLS from
> the existing proof for TLS. In the first place, the threat model is
> different because in DTLS we need to tolerate dropped/out-of-order packets.
> Nevertheless, I think the general principle of "authenticate all the bits"
> is the right way to go here, unless there's a compelling reason not to.
>
> In the case of TLS 1.3, authenticating the entire header (including the
> length, opaque type, and legacy record version) allowed us to effectively
> ignore most of the header details in the security proof [1]: all we cared
> about is that the header correctly encodes the length of the next
> ciphertext to decrypt. We might be able to provide a similar argument for
> DTLS 1.3. In particular, I'm betting that it doesn't matter what the
> contents of the header are or how long it is, so long as (a) the entire
> header is part of the AAD and (b) it correctly encodes the length of the
> next ciphertext.
>
> I might be missing something, however. In any case, new definitions are
> needed (if they don't already exist) and so too a fresh proof.
>
> Chris P.
>
> [1] https://eprint.iacr.org/2018/634.pdf
>
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
>