[openpgp] AEAD mode chunk size

Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de> Sat, 30 June 2018 16:00 UTC

Return-Path: <marcus.brinkmann@ruhr-uni-bochum.de>
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 C3AAA1310C3 for <openpgp@ietfa.amsl.com>; Sat, 30 Jun 2018 09:00:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.301
X-Spam-Level:
X-Spam-Status: No, score=-4.301 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ruhr-uni-bochum.de
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 g7XD-yaAQ8IV for <openpgp@ietfa.amsl.com>; Sat, 30 Jun 2018 09:00:44 -0700 (PDT)
Received: from out2.mail.ruhr-uni-bochum.de (out2.mail.ruhr-uni-bochum.de [134.147.42.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 59432130F5C for <openpgp@ietf.org>; Sat, 30 Jun 2018 09:00:44 -0700 (PDT)
Received: from mx2.mail.ruhr-uni-bochum.de (localhost [127.0.0.1]) by out2.mail.ruhr-uni-bochum.de (Postfix mo-ext) with ESMTP id 41Hysj5GPsz4y1C for <openpgp@ietf.org>; Sat, 30 Jun 2018 18:00:41 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ruhr-uni-bochum.de; s=mail-2017; t=1530374441; bh=jkxj8R+sPE1NsVzvpeksTesNV05lOakVKLmlW1dGmhA=; h=To:From:Subject:Date:From; b=F2gkurNr6gv5v2jkPlJGCnUlFT8FtJZ81oUpvLgqlwW4kLDjseO4Z2YOjJPifNVgX +DWoUDRTPGcdjwvulU6NTSOcD2eGAuiZ9FQMH3uVtmcl52FXKCIile8AzCvxuoL4Bd Qo/Yj5L93lBUdOwraaADGnCEpalQDP+GRm06CdR0=
Received: from out2.mail.ruhr-uni-bochum.de (localhost [127.0.0.1]) by mx2.mail.ruhr-uni-bochum.de (Postfix idis) with ESMTP id 41Hysj4YN3z4y3N for <openpgp@ietf.org>; Sat, 30 Jun 2018 18:00:41 +0200 (CEST)
X-Envelope-Sender: <marcus.brinkmann@ruhr-uni-bochum.de>
X-RUB-Notes: Internal origin=134.147.42.227
Received: from mail1.mail.ruhr-uni-bochum.de (mail1.mail.ruhr-uni-bochum.de [134.147.42.227]) by out2.mail.ruhr-uni-bochum.de (Postfix mi-int) with ESMTP id 41Hysj4FBTz4y1C for <openpgp@ietf.org>; Sat, 30 Jun 2018 18:00:41 +0200 (CEST)
Received: from [192.168.142.139] (p4FE3FA2B.dip0.t-ipconnect.de [79.227.250.43]) by mail1.mail.ruhr-uni-bochum.de (Postfix) with ESMTPSA id 41Hysh4zXmzyXy for <openpgp@ietf.org>; Sat, 30 Jun 2018 18:00:40 +0200 (CEST)
To: IETF OpenPGP <openpgp@ietf.org>
From: Marcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Openpgp: preference=signencrypt
Message-ID: <b82fee80-d265-5659-fad0-8cc47cce2703@ruhr-uni-bochum.de>
Date: Sat, 30 Jun 2018 18:00:40 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.99.4 at mail1.mail.ruhr-uni-bochum.de
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/openpgp/t79iRZ80KHuVTEyVVLAoCLl4Rwc>
Subject: [openpgp] AEAD mode chunk size
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.26
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: Sat, 30 Jun 2018 16:00:47 -0000

Hi,

RFC4880bis contains this segment:

   The chunk size octet specifies the size of chunks using the following
   formula (in C), where c is the chunk size octet:

       chunk_size = ((uint64_t)1 << (c + 6))

   An implementation MUST support chunk size octets with values from 0
   to 56.  Chunk size octets with other values are reserved for future
   extensions.

This allows chunk size up to 2^(6+56) = 4 EiB. It is impossible to
implement AEAD correctly with chunk sizes larger than can be buffered in
RAM. A large chunk size would require output of unverified plaintext,
enabling attacks like EFAIL but also others.

To implement AEAD correctly, chunk size must be limited to reasonable
sizes. TLS uses a chunk size up to 2^14 (16 KiB), but any reasonable
limit will do, for example 64 KiB. I suggest to change the text to this:

   The chunk size octet specifies the size of chunks using the following
   formula (in C), where c is the chunk size octet:

       chunk_size = ((uint64_t)1 << c)

   An implementation MUST support chunk size octets with values from 0
   to 16.  Chunk size octets with other values are reserved for future
   extensions.

Thanks,
Marcus Brinkmann