Re: [TLS] close_notify and TLS 1.3

David Benjamin <davidben@chromium.org> Sat, 11 November 2017 23:46 UTC

Return-Path: <davidben@google.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 5F12A1293E1 for <tls@ietfa.amsl.com>; Sat, 11 Nov 2017 15:46:24 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.698
X-Spam-Level:
X-Spam-Status: No, score=-2.698 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.org
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 myrrUm2UHVLT for <tls@ietfa.amsl.com>; Sat, 11 Nov 2017 15:46:22 -0800 (PST)
Received: from mail-qk0-x22a.google.com (mail-qk0-x22a.google.com [IPv6:2607:f8b0:400d:c09::22a]) (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 2A62B1293DF for <tls@ietf.org>; Sat, 11 Nov 2017 15:46:21 -0800 (PST)
Received: by mail-qk0-x22a.google.com with SMTP id v137so15976267qkb.1 for <tls@ietf.org>; Sat, 11 Nov 2017 15:46:21 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AsQgNd5jMRuFE1gGzWKGz4aPQrbJAYMjX4DaToQ5sRk=; b=fP+f1oXl/4BoS28I67hrTIuHD1r9q/hDaPQXXA1ktfFB3ezbCqP8H7i20F1zHQvm99 14ndhGYF2alUXjKLDgmG7Gpili686qeG+mvX9WHwqX504rGjEqb/E+w2VCzOiN6t31k5 HVb5JfdOyBp6YH5VSb/9h+a5MbDtpT9sPZ/Xo=
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=AsQgNd5jMRuFE1gGzWKGz4aPQrbJAYMjX4DaToQ5sRk=; b=kHhthEwKX+u/jz5KBwpJNXG500iu3eApEiExSOHJBnzsSou0kKR5k3h/Cftn2R1j8E Cmp/QAJ2D+nTfzs/KMbRmDWFgEPmV8uqRaowHrjdWETFLrs2Lz4BUODkcJLBAxSUUR/G gjegjnswgdpcBuW8p4k4/n/ttO8H3gI8z6l8jclWP6vM8fr4Xvg77osvabT7EmqHRtUv 8ukBblM1BKPFAjueJYpUXHvSp7uT7ZaO8lDoq3jT8vqR1kkJiVwm4fa9FAAFGgfX0JFQ 27xB2cSJMwf/H61TsqF/OsjM+g5WLFZRDBe8BycyjZY0t5MJwdPkCSMZ9A7Om1O8Yr45 gguQ==
X-Gm-Message-State: AJaThX6iRpbPqbUEQoJp18CiX92Kxu3Qgw7iEZT0Sn+4n9pivnnYD/e+ nkkuweNflQV19Bz2YSi/RLv3yllANh+ek23HD2Rc
X-Google-Smtp-Source: AGs4zMYb7ZpQI60+ea1d0rSwVNTrHFsqbIkikDyXGShiwG2dObnmgZlfZ+/XDjB+EtcC46kxi9GMyLwZtXmVyLZ6UxE=
X-Received: by 10.55.3.130 with SMTP id 124mr4154147qkd.197.1510443980925; Sat, 11 Nov 2017 15:46:20 -0800 (PST)
MIME-Version: 1.0
References: <A6C599ED-3F3D-462F-9B39-1FEF6A0B549B@apple.com> <CABkgnnU3OuzEm2gF6BYif4c0evAfzUYH-PpxoERD9xFEosQ_oQ@mail.gmail.com>
In-Reply-To: <CABkgnnU3OuzEm2gF6BYif4c0evAfzUYH-PpxoERD9xFEosQ_oQ@mail.gmail.com>
From: David Benjamin <davidben@chromium.org>
Date: Sat, 11 Nov 2017 23:46:08 +0000
Message-ID: <CAF8qwaB2fXoiy8RLdg9Kc+5xAoCgU2JkoHXw8H-xSsEXMWWgXg@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Cc: David Schinazi <dschinazi@apple.com>, "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="001a114c96e4f05733055dbda48b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/2b1oebTig-mpqcJ8a-HImYwExNk>
Subject: Re: [TLS] close_notify and TLS 1.3
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
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: Sat, 11 Nov 2017 23:46:24 -0000

I think this change is a good idea.

Our implementation actually does this already anyway. We are happy to
continue servicing writes even when the read half has consumed a
close_notify. I believe we inherited this behavior from OpenSSL, so it
should be there too. Go's crypto/tls implementation appears to also already
do this.

We don't have a particular need for the half-close semantics that I know
of, but I don't care for the current spec text (it requires yet another
undesirable read/write sync point). Aligning with TCP's semantics is also
generally a good default.

On Sat, Nov 11, 2017 at 11:18 PM Martin Thomson <martin.thomson@gmail.com>
wrote:

> This seems like it might be worth looking at.  This seems to be
> something that harks back to SSL3 or even earlier.  We aren't going to
> make it so that you can rely on this behaviour, but we might be able
> to make it possible to half-close, which for new protocols using TLS
> could be hugely useful.
>
> On Sat, Nov 11, 2017 at 5:21 PM, David Schinazi <dschinazi@apple.com>
> wrote:
> > Hello all,
> >
> > Currently TLS 1.3 specifies close_notify in the same way that TLS 1.2
> did.
> > I believe that has issues and this might be the right time to fix them.
> > The purpose of close_notify is to protect against data truncation
> attacks,
> > each side is required to send close_notify before closing the write side
> of
> > the transport connection so the other side knows that the data was not
> > truncated.
> > As such, close_notify only needs half-close semantics to prevent
> truncation.
> >
> > However, the specification contains the following text:
> > << Each party MUST send a “close_notify” alert before closing the write
> side
> >     of the connection, unless some other fatal alert has been
> transmitted.
> >     The other party MUST respond with a “close_notify” alert of its own
> and
> > close
> >     down the connection immediately, discarding any pending writes. >>
> >
> > This means that an application-layer client can't send a query then close
> > their
> > write transport when they know that they're done, because the server
> would
> > terminate the TLS session before sending the reply. On top of this, when
> > the server receives the close_notify, it may have already sent part of
> the
> > reply
> > (or wrote it to the socket send buffer) so the responding close_notify
> would
> > in effect be inflicting a truncation attack on the client.
> >
> > This doesn't make much difference for HTTP because clients already
> > don't close their write transport after sending a reply, however having
> the
> > option do do this could allow innovation in new protocols that can define
> > the semantics of when they use close_notify. An example is DNS PUSH:
> > https://tools.ietf.org/html/draft-ietf-dnssd-push
> >
> > A proposal to solve this problem would be to give close_notify half-close
> > semantics: we keep the requirements that a close_notify be sent before
> > closing the transport, and that any data received after a close_notify is
> > ignored, but we simply remove the requirement to immediately reply
> > with a close_notify. This has the advantage that current implementations
> > are already compliant but future ones can leverage this improvement.
> >
> > What do you think? Is this worth discussing on Thursday?
> >
> > Thanks,
> > David Schinazi
> >
> > _______________________________________________
> > TLS mailing list
> > TLS@ietf.org
> > https://www.ietf.org/mailman/listinfo/tls
> >
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>