Re: [TLS] TLS 1.3 and max_fragment_length

Yoav Nir <ynir.ietf@gmail.com> Tue, 14 March 2017 11:26 UTC

Return-Path: <ynir.ietf@gmail.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 3D420129535 for <tls@ietfa.amsl.com>; Tue, 14 Mar 2017 04:26:27 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 K4KhPZpKCiOI for <tls@ietfa.amsl.com>; Tue, 14 Mar 2017 04:26:25 -0700 (PDT)
Received: from mail-wr0-x22f.google.com (mail-wr0-x22f.google.com [IPv6:2a00:1450:400c:c0c::22f]) (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 B764712943B for <tls@ietf.org>; Tue, 14 Mar 2017 04:26:24 -0700 (PDT)
Received: by mail-wr0-x22f.google.com with SMTP id g10so121921928wrg.2 for <tls@ietf.org>; Tue, 14 Mar 2017 04:26:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=cvhLhbXi66h6s2dGHnUrRUlg9jIw5BXpnLe1fbAuQ2s=; b=CJiQFuQJd3RtMhPFS2108wi/0Ln7V6wcsrfSYomUC/ulSgsDyq+6oiqnJ/wF4eLycz Gw+c+Qud+1WTtBJSUF63Y9cy0vcAGih/BS/lrP6IPfejDCkKHaWqJOxb7bQpANzZWqY7 8onxAmXahETlbCCW2L2bTNXj5BPFgNr1i9Hl2PefDfWs079NMiq8+ZtZSfdSmFnMLpvC aHKqaw2zPG+BTrB715Aw48Shcec4O0Ja6+5bP1aSOKV8nboWmw4ptkgSSgrLVIwPEm2g 2TxxFXzBEexDO3tOcMefYmPYAgusy1G2hHrry8x54VZwITpzvlr3ga/i1t6fUYsEaQSC +7gA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=cvhLhbXi66h6s2dGHnUrRUlg9jIw5BXpnLe1fbAuQ2s=; b=H0pXq2yEWBJoTfFE2NK0NBWPm0qWNJFAFk5HZB7JFZ8z9XsPR8p3ewtzIMjSoHIuDR Kx6XW3AxVqAw6iBzIUU+UdzEMrZr7P81CKbFoCSBZicE+uPYqejbyTYYnv96qtC5y9S2 /wakQM1yhfoU+HUH7EubIx5fU1pvf17w7OBwtk4LFnm9InYPDREHOF9Vuxh97U2owiwI aGJpxvSEsU56k5hSdIxU9z7IefZGMt62kN5eMz+BK+V7r9IK0xV0DznlIcykrARdPYvc hCaY7g5piPUTtVw0824zwL9yKnyAcv/dhwar5cf2hZBIfUQv5ULHYpkVOIswVdrXfpWf HBsw==
X-Gm-Message-State: AMke39n7jc3RHuqc3rJ1XSbOAfACbSO6wJUG4XybAasqwyBkLYpYEHSqQ8hCI1SHotDL9A==
X-Received: by 10.223.140.25 with SMTP id z25mr33067919wra.101.1489490783274; Tue, 14 Mar 2017 04:26:23 -0700 (PDT)
Received: from [172.24.251.163] (dyn32-131.checkpoint.com. [194.29.32.131]) by smtp.gmail.com with ESMTPSA id b199sm15069906wmb.13.2017.03.14.04.26.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Mar 2017 04:26:22 -0700 (PDT)
From: Yoav Nir <ynir.ietf@gmail.com>
Message-Id: <C0EB8EFF-8972-4FD7-8EB7-3C8FC2DF0759@gmail.com>
Content-Type: multipart/signed; boundary="Apple-Mail=_0EDD180E-7E06-487D-94E8-79BD41D46302"; protocol="application/pgp-signature"; micalg="pgp-sha512"
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
Date: Tue, 14 Mar 2017 13:26:19 +0200
In-Reply-To: <20170314110443.GB18882@LK-Perkele-V2.elisa-laajakaista.fi>
To: Ilari Liusvaara <ilariliusvaara@welho.com>
References: <CABkgnnWZgo5xs=+26j6C=o+AMgWHmyQwuMWw7vL=+xvRnpZgog@mail.gmail.com> <ECEFBB0A-43C5-4DB2-8C2D-75763669957B@gmail.com> <20170314110443.GB18882@LK-Perkele-V2.elisa-laajakaista.fi>
X-Mailer: Apple Mail (2.3259)
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/PHHbarbZ84EnysQqeZ5ahBbAPPA>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] TLS 1.3 and max_fragment_length
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.17
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: Tue, 14 Mar 2017 11:26:27 -0000

On 14 Mar 2017, at 13:04, Ilari Liusvaara <ilariliusvaara@welho.com> wrote:

> On Tue, Mar 14, 2017 at 11:10:54AM +0200, Yoav Nir wrote:
>> 
>>> On 14 Mar 2017, at 5:38, Martin Thomson <martin.thomson@gmail.com> wrote:
>>> 
>>> When we added padding to TLS 1.3, we created an ambiguity with the
>>> max_fragment_length extension.
>>> 
>>> Does the limit apply to len(TLSInnerPlaintext) or does it apply to
>>> len(TLSInnerPlaintext.content) (i.e., TLSPlaintext.length)?  That is,
>>> does is include the padding and content type, or not?
>>> 
>>> Including the padding would recognize the limitations apply to
>>> handling large blobs of encrypted data (see earlier email from Thomas
>>> Pornin).  That would be my preference.  I think that we need to say
>>> that though.  I guess the second-order question is whether to roll
>>> RFC6066-bis or patch these things in TLS 1.3 directly.
>>> 
>>> (BTW, RFC 6066 is quite poor.  It's not very precise in identifying
>>> what it is talking about, it also describes a negotiation design
>>> unlike anything else in TLS, one that can't be extended ever.)
>> 
>> Well, I can’t think of a single rational argument in favor of it
>> *not* including the padding, so I guess I agree that it does.
>> 
>> If it didn’t include the padding, then any record with length
>> greater than the max_fragment_length would be obviously padded.
>> Why leak that?
> 
> Actually, even worse, then the padding would require extra memory,
> which the endpoint presumably does not have.
> 
> If you limit padded plaintext length to 513 bytes (the minimum
> needed for 512 byte plaintext), with current ciphers, the record
> payload is at most 529 bytes (16 byte tag is added). Thus, you
> can receive the record into 529 byte buffer and decrypt in
> place.
> 

Seems we’re in agreement. So how about modifying the sixth paragraph in section 5.4?

OLD:
   The presence of padding does not change the overall record size
   limitations - the full fragment plaintext may not exceed 2^14 octets.

NEW:
   The presence of padding does not change the overall record size
   limitations - the full fragment plaintext may not exceed 2^14 octets. If
   the maximum fragment length is reduced by the presence of the
   max_fragment_length extension from [RFC6066] then the reduced limit
   applies to the full plaintext, including the padding.


Yoav