Re: [TLS] Sending fatal alerts over TCP

Bodo Moeller <bmoeller@acm.org> Wed, 21 December 2011 10:07 UTC

Return-Path: <SRS0=wbl3=7B=acm.org=bmoeller@srs.kundenserver.de>
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 B2C7221F8467 for <tls@ietfa.amsl.com>; Wed, 21 Dec 2011 02:07:12 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -101.604
X-Spam-Level:
X-Spam-Status: No, score=-101.604 tagged_above=-999 required=5 tests=[AWL=0.022, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HELO_EQ_DE=0.35, HTML_MESSAGE=0.001, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r6tQmy2fCX3u for <tls@ietfa.amsl.com>; Wed, 21 Dec 2011 02:07:12 -0800 (PST)
Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.10]) by ietfa.amsl.com (Postfix) with ESMTP id C78A021F845F for <tls@ietf.org>; Wed, 21 Dec 2011 02:07:11 -0800 (PST)
Received: from mail-qw0-f44.google.com (mail-qw0-f44.google.com [209.85.216.44]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0La6Uk-1QyyJs2S1G-00m3vE; Wed, 21 Dec 2011 11:07:10 +0100
Received: by qadb15 with SMTP id b15so3733741qad.10 for <tls@ietf.org>; Wed, 21 Dec 2011 02:07:09 -0800 (PST)
MIME-Version: 1.0
Received: by 10.224.98.8 with SMTP id o8mr7226639qan.79.1324462029588; Wed, 21 Dec 2011 02:07:09 -0800 (PST)
Received: by 10.224.19.196 with HTTP; Wed, 21 Dec 2011 02:07:09 -0800 (PST)
In-Reply-To: <201112210352.pBL3qcvd022885@fs4113.wdf.sap.corp>
References: <201112202125.pBKLPh03000374@fs4113.wdf.sap.corp> <201112210352.pBL3qcvd022885@fs4113.wdf.sap.corp>
Date: Wed, 21 Dec 2011 11:07:09 +0100
Message-ID: <CADMpkcKW0BomJCpKNPyjT+G9Ch3zNEOdivX4vryRdC+6N9JGzA@mail.gmail.com>
From: Bodo Moeller <bmoeller@acm.org>
To: tls@ietf.org
Content-Type: multipart/alternative; boundary="20cf3074d9a6cac84104b497589e"
X-Provags-ID: V02:K0:3san2K86oKR2Yy1ZfBw9qJgrnYnr9WdPu8wjkvCawtQ V2tmoT9jLxb9HzKFw6MK/2TvPDv/kZoohWUzheFcyoDmezUvGa EGg47YL+PDGTNgJ1T48qWL1WtEMC7ZmrpDLQZ1054QWxn549Yr eA0+ar7Dasz7wQUbUYa/sgrbo7qluOvpqaKnsvT+93kK59wkao zhb0NJwIXYuE+6IDIDy0D0pTUdXsJc5Grrx79+c0uMV0HyQVOj +LamJEEswldI1QECIt5YXvZp70u/XYWTzyi073DUnY9gLrN5vd JgeAw/eAmm3FVjro25UwU/TSI3Yym0P1QrEVAcrDm+DQjoAijN 5UXKGw5XW/vBWroHg/M9kNGqBlvXe89fZz1HtH+oCc69+Z1cUG t46YbGm+hZG07jlo77QVNR8mt+yQPfBEk8lIQ0650HQcRaHZVX /yo5R
Subject: Re: [TLS] Sending fatal alerts over TCP
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Wed, 21 Dec 2011 10:08:02 -0000

> > > (1)  X sends a fatal TLS alert to Y
> > > (2)  X shuts down the connection
> > > (3)  Y sends data to X
> > > (4)  X receives from Y, sends RST to signal data loss to Y
> > > (5)  Y receives RST
> > >
> > > (6) At this point, when Y tries to send further data,
> > > it will receive EPIPE from the sockets API.
> > > When it tries to read data, it will receive ECONNRESET.
>


> As long as Y does not call shutdown() on the socket, it will
> receive all data that arrived on the socket prior to seeing
> End-of-file (X with SO_LINGER) or ECONNRESET (X without SO_LINGER)
> on recv().
>
>
That's not right.  Upon receiving RST, Y's TCP will reset the state for
this connection and discard any data already buffered; no further data can
be received by the application (in this case, by the TLS implementation);
check RFC 793 for RST processing details.  If X doesn't want that, it must
not send an RST.

(With a fatal alert, that doesn't sound *that* problematic because there's
a problem anyway.  I've seen TLS servers send RSTs instead of cleanly
closing the connection when there was *no* error, which is very bad because
then you depend on client-side scheduling -- if the TLS client isn't able
to process the response before the TLS connection is killed, you have a
problem.)

Bodo