Re: [openpgp] AEAD Chunk Size

"Neal H. Walfield" <neal@walfield.org> Fri, 01 March 2019 08:45 UTC

Return-Path: <neal@walfield.org>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 77C081311F5 for <openpgp@ietfa.amsl.com>; Fri, 1 Mar 2019 00:45:30 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 3.101
X-Spam-Level: ***
X-Spam-Status: No, score=3.101 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, GB_SUMOF=5, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
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 N6-133OiBItF for <openpgp@ietfa.amsl.com>; Fri, 1 Mar 2019 00:45:28 -0800 (PST)
Received: from mail.dasr.de (mail.dasr.de [217.69.77.164]) (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 851DB130E11 for <openpgp@ietf.org>; Fri, 1 Mar 2019 00:45:28 -0800 (PST)
Received: from [46.183.103.8] (helo=chu.huenfield.org.walfield.org) by mail.dasr.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from <neal@walfield.org>) id 1gzdnH-0004Us-La; Fri, 01 Mar 2019 08:45:23 +0000
Date: Fri, 01 Mar 2019 09:45:22 +0100
Message-ID: <87r2brf0f1.wl-neal@walfield.org>
From: "Neal H. Walfield" <neal@walfield.org>
To: Jon Callas <joncallas@icloud.com>
Cc: Jon Callas <joncallas=40icloud.com@dmarc.ietf.org>, Bart Butler <bartbutler@protonmail.com>, "openpgp@ietf.org" <openpgp@ietf.org>, Vincent Breitmoser <look@my.amazin.horse>
In-Reply-To: <35C892F7-18A8-401E-828D-5CE180A3A731@icloud.com>
References: <87mumh33nc.wl-neal@walfield.org> <F9VLV9HZWH.3RYL3UM3BN873@my.amazin.horse> <3WZ7-hy9V7TOy53p1gP5EXELzHJIqjouV9x0YTN3PWsBZedKkqvVCRm-2XzGZy-FYAYdTqP1-7YV4wbTWMWAYhSujQA6NmrnIuXfZLRHkdQ=@protonmail.com> <CAB941EE-6961-4CAB-9632-DFF738980467@icloud.com> <87h8co2t4v.wl-neal@walfield.org> <35C892F7-18A8-401E-828D-5CE180A3A731@icloud.com>
User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL/10.8 EasyPG/1.0.0 Emacs/24.5 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)
MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue")
Content-Type: text/plain; charset=ISO-2022-JP
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/zpwXstOMPF9HzACpGZ4B6dZ4M_k>
Subject: Re: [openpgp] AEAD Chunk Size
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 01 Mar 2019 08:45:31 -0000

At Thu, 28 Feb 2019 10:39:17 -0800,
Jon Callas wrote:
> > On Feb 28, 2019, at 12:51 AM, Neal H. Walfield <neal@walfield.org> wrote:
> >> So I think that a SHOULD is the right way to put it. I care less
> >> about what the SHOULD limit should be, but a small hard limit sounds
> >> like a bad idea.
> > 
> > Do you still think a hard upper limit is a bad idea?
> 
> No, I don’t think a hard upper limit is a bad idea. In the text you quote above, I said a *small* hard upper limit. And no, I don’t know what small means. I think 16K is small. 256K might be small. AES-GCM has issues about 64G. One might argue that’s a reasonable large upper limit. Me, I think anything in the few megabytes to a gigabyte-ish is just fine.
> 
> Let me rewind a bit and get to my real point which I don’t think I’m making well.
> 
> When one creates a standard, one needs to be careful with
> parameters, particularly the MUSTs. Seemingly sensible things can
> have downstream effects that convince people to use some other
> protocol. Worse, someone’s angry blog post about something can
> quickly go into “not even wrong” territory and embed itself into
> folklore and you can’t get it out. There are plenty of bad ideas
> that someone else has a really reasonable use case for.

There are always going to be haters.

> ...

> This has never caused a problem that I’m aware of. I’m sure it caused a problem that none of us are aware of, and the implementors just solved it on their own. It is this experience that has me wondering about what the restrictions out to be.
> 
> The best way to deal with it in a standard is to have non-normative guidance. It is non-normative guidance that I was suggesting. Let me write an example bit of non-normative guidance below:
>  ...

I think that security concerns should be our first priority.  And, any
flexibility increases our bug potential.  As such, I'm not convinced
that we shouldn't use a fixed chunk size.  If in a few years, if we
decide that the size is wrong, then we can just define a new mode,
which uses a different chunk size.  In my opinion, it should be
impossible represent something that we want to disallow.

If we are really worried about the haters, then let's just deflect the
criticism: let's use 16 kiB chunks like TLS, as Marcus previously
pointed out:

  https://mailarchive.ietf.org/arch/msg/openpgp/t79iRZ80KHuVTEyVVLAoCLl4Rwc

From RFC 8446:

  5.2.  Record Payload Protection

    length:  The length (in bytes) of the following
      TLSCiphertext.encrypted_record, which is the sum of the lengths of
      the content and the padding, plus one for the inner content type,
      plus any expansion added by the AEAD algorithm.  The length
      MUST NOT exceed 2^14 + 256 bytes.  An endpoint that receives a
      record that exceeds this length MUST terminate the connection with
      a "record_overflow" alert.

  https://tools.ietf.org/html/rfc8446#section-5.2

(A record the approximate equivalent of a chunk.)

> The Partial Body Lengths that OpePGP has had from the beginning have no restrictions on them. There’s non-normative guidance that pretty much says you shouldn’t even use them, but there’s no restriction on size.

I just reread and I don't think it suggests that Partial Body Lengths
should not be used.

  https://tools.ietf.org/html/rfc4880#section-4.2.2.4

Can you point me to this guidance?  This is the first time I hear that
chunking is considered to be a bad idea.

Thanks,

:) Neal