Re: [TLS] Fwd: Clarification on interleaving app data and handshake records

mrex@sap.com (Martin Rex) Wed, 14 October 2015 15:44 UTC

Return-Path: <mrex@sap.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7D6961ACCE1 for <tls@ietfa.amsl.com>; Wed, 14 Oct 2015 08:44:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.551
X-Spam-Level:
X-Spam-Status: No, score=-6.551 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001] autolearn=ham
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 Ot9wPEqcDRma for <tls@ietfa.amsl.com>; Wed, 14 Oct 2015 08:44:04 -0700 (PDT)
Received: from smtpde01.smtp.sap-ag.de (smtpde01.smtp.sap-ag.de [155.56.68.170]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A289A1ACCDF for <tls@ietf.org>; Wed, 14 Oct 2015 08:44:03 -0700 (PDT)
Received: from mail05.wdf.sap.corp (mail05.sap.corp [194.39.131.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtpde01.smtp.sap-ag.de (Postfix) with ESMTPS id 000DF2AC55; Wed, 14 Oct 2015 17:44:01 +0200 (CEST)
X-purgate-ID: 152705::1444837442-00001EB9-A701F08D/0/0
X-purgate-size: 3669
X-purgate: clean
X-purgate: This mail is considered clean (visit http://www.eleven.de for further information)
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate-type: clean
X-SAP-SPAM-Status: clean
Received: from ld9781.wdf.sap.corp (ld9781.wdf.sap.corp [10.21.82.193]) by mail05.wdf.sap.corp (Postfix) with ESMTP id E6DE240498; Wed, 14 Oct 2015 17:44:01 +0200 (CEST)
Received: by ld9781.wdf.sap.corp (Postfix, from userid 10159) id DF1401A2E6; Wed, 14 Oct 2015 17:44:01 +0200 (CEST)
In-Reply-To: <561CCB0D.6020506@baggins.org>
To: Matt Caswell <frodo@baggins.org>
Date: Wed, 14 Oct 2015 17:44:01 +0200
X-Mailer: ELM [version 2.4ME+ PL125 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="US-ASCII"
Message-Id: <20151014154401.DF1401A2E6@ld9781.wdf.sap.corp>
From: mrex@sap.com
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/lMW-E2sDqfnzEi1GuumGMf7YPf4>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Fwd: Clarification on interleaving app data and handshake records
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: mrex@sap.com
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: Wed, 14 Oct 2015 15:44:08 -0000

Matt Caswell wrote:
> 
> Does anyone have any views on the below?

Yup.  Interleaving application & handshake records is a
highly dangerous idea (and fortunately some TLS implementations
will abort if you try).

http://www.ietf.org/mail-archive/web/tls/current/msg07648.html

http://www.ietf.org/mail-archive/web/tls/current/msg09743.html


-Martin

> On 30/09/15 11:06, Matt Caswell wrote:
> > Hi all
> >
> > I have a question on how to interpret RFC 5246 with regards to the
> > interleaving of app data and handshake records.
> >
> > RFC 5246 (and RFC 4346 before it) contains these words:
> >
> >    Note: Data of different TLS Record layer content types MAY be
> >    interleaved.  Application data is generally of lower precedence for
> >    transmission than other content types.  However, records MUST be
> >    delivered to the network in the same order as they are protected by
> >    the record layer.  Recipients MUST receive and process interleaved
> >    application layer traffic during handshakes subsequent to the first
> >    one on a connection.
> >
> > This wording seems to place no limits whatsoever on when it is valid to
> > receive app data in the handshake. By the wording in the RFC it would be
> > valid for app data to be received *after* the ChangeCipherSpec has been
> > received but *before* the Finished has been processed.
> >
> > There is also this wording:
> >
> >    Note: If a rehandshake occurs while data is flowing on a connection,
> >    the communicating parties may continue to send data using the old
> >    CipherSpec.  However, once the ChangeCipherSpec has been sent, the
> >    new CipherSpec MUST be used.  The first side to send the
> >    ChangeCipherSpec does not know that the other side has finished
> >    computing the new keying material (e.g., if it has to perform a
> >    time-consuming public key operation).  Thus, a small window of time,
> >    during which the recipient must buffer the data, MAY exist.  In
> >    practice, with modern machines this interval is likely to be fairly
> >    short.
> >
> > I think this means that as soon as the first party sends a CCS, they
> > must not send any app data until they have received a CCS back - they
> > must buffer it until the CCS is seen - but on reading it again I'm not
> > sure! If that were the case then the second party should never expect to
> > see app data between CCS and Finished. It doesn't tell you anything
> > about what the first party can expect though, i.e. is the second party
> > allowed to send app data between the CCS and Finished?
> >
> > Finally there is also this:
> >
> >    A Finished message is always sent immediately after a change
> >    cipher spec message to verify that the key exchange and
> >    authentication processes were successful.
> >
> > I suppose this trumps everything else, although as this section is
> > specifically talking about handshakes you could interpret "immediately"
> > as applying to the handshake sequence only without saying anything about
> > interleaved app data records.
> >
> > I believe the intention is that app data should not be sent between the
> > CCS and Finished but the RFC wording is not exactly crystal clear. This
> > is the interpretation I have taken whilst fixing this OpenSSL bug:
> >
> > https://rt.openssl.org/Ticket/Display.html?id=3712&user=guest&pass=guest
> >
> > Can some confirm my interpretation is correct?
> >
> > Thanks
> >
> > Matt
> >
> >
> 
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls