Re: [TLS] 1rtt thoughts

Eric Rescorla <ekr@rtfm.com> Mon, 14 July 2014 20:19 UTC

Return-Path: <ekr@rtfm.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 7A50C1A0AF1 for <tls@ietfa.amsl.com>; Mon, 14 Jul 2014 13:19:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 A1rAt-y2MQzO for <tls@ietfa.amsl.com>; Mon, 14 Jul 2014 13:19:35 -0700 (PDT)
Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B2E061A0AA2 for <tls@ietf.org>; Mon, 14 Jul 2014 13:19:34 -0700 (PDT)
Received: by mail-wi0-f174.google.com with SMTP id d1so3207952wiv.13 for <tls@ietf.org>; Mon, 14 Jul 2014 13:19:33 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=gEjSqwmEkLqa4JfOeEroN1aBqdtb6SlVH8xGP1IInzQ=; b=QckrgW//IEadIYZoieUJPVivn3HusYowylNyLspOAU/RHo1paZf5ioA8+xAcZxLZIS 0+aQt6OSuGzQcqnI92DB/P7vmdyYCnWg/nf4BFBAvd8oOcCXckYYbBvbzsCgyCpO8qSz hcSC+/o+emtn7oec2gDNGOAQCozVJCwgtauUCOz9byPc8ducCnwNdq2O8NBJauu6ZQJZ QfLgiK9QQER1qeUnovW9nII5i3ixLrkIrvZvKrgj7rJz3mJgDkmuy7kz35wNSoULLoH1 vXMfDuG5ius7SajyXwENIWV4GG8G1TUhYeMdrYXqpp9g5ICby+fK9Pf6/zaK38QvW6RP 9tWA==
X-Gm-Message-State: ALoCoQnEEPAiNVqlewxagFo6qj2ngG7hJJcc5+0b3ZUySBa7oxK0PrimrHpz99OhiBNYkju3Abl/
X-Received: by 10.180.89.143 with SMTP id bo15mr265877wib.78.1405369173311; Mon, 14 Jul 2014 13:19:33 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.217.128.12 with HTTP; Mon, 14 Jul 2014 13:18:53 -0700 (PDT)
X-Originating-IP: [2620:101:80fc:232:2849:f520:57d7:53d0]
In-Reply-To: <53C4385A.7030007@nthpermutation.com>
References: <53C41080.9050204@nthpermutation.com> <CAMfhd9VjAjdgkrYY-YXyqtgZ95gK=qHMgkv3Sv2uou7HLT2eyg@mail.gmail.com> <CABcZeBO0OcS6LCuLBN-qgo_M2jNr4EwE65tN4fmJ93qTuJyDFw@mail.gmail.com> <53C4385A.7030007@nthpermutation.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Mon, 14 Jul 2014 13:18:53 -0700
Message-ID: <CABcZeBOegbc78eDndp8uJkTpQJ7onQTM6KH0xX8WVcinUPeRJA@mail.gmail.com>
To: Michael StJohns <msj@nthpermutation.com>
Content-Type: multipart/alternative; boundary="e89a8f3bab875a9af104fe2d0228"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/CGyxwvbQ50G72O3TKzkgdnn8qms
Cc: Adam Langley <agl@imperialviolet.org>, "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] 1rtt thoughts
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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: Mon, 14 Jul 2014 20:19:37 -0000

A large fraction of existing TLS servers will respond to this situation by
generating a fatal alert and closing the connection.That makes this
approach a nonstarter.

Given that, whether it is possible for a compliant TLS server to behave
differently seems like a largely academic question.

-Ekr


On Mon, Jul 14, 2014 at 1:06 PM, Michael StJohns <msj@nthpermutation.com>
wrote:

>  On 7/14/2014 1:49 PM, Eric Rescorla wrote:
>
>
>
>
> On Mon, Jul 14, 2014 at 10:27 AM, Adam Langley <agl@imperialviolet.org>
> wrote:
>
>> On Mon, Jul 14, 2014 at 10:16 AM, Michael StJohns
>> <msj@nthpermutation.com> wrote:
>> > A
>> > TLS1.2 server receiving things in this order discards the
>> ClientKeyExchange
>> > with an out of sequence error, and then starts the handshake normally
>> with
>> > the receipt of the ClientHello.
>>
>>  I've never encountered a TLS 1.2 implementation that will discard an
>> unexpected handshake message like that as opposed to sending a fatal
>> alert (maybe) and closing the connection.
>>
>
>  Indeed, it's required by TLS.
>
>
> Umm...
>
> Part of the problem I have at times in discussions about TLS is the
> confusion between what happens as part of the transport connection and what
> happens as part of the TLS connection.  I think of TLS as a record
> connection over a bearer transport service.  They interact, but not
> strongly, and usually not without intervention from the client or server
> application.  The TLS thing (server, message processor, etc) attached to
> the server side of the transport connection snarfs up individual TLS
> records one by one and processes them according to its current state.
>
> While you're both correct that TLS requires the "connection" to be closed
> in the event of a fatal error  (and here I'm referring to 7.2.2 of
> RFC5246), the context of the word "connection" in that section doesn't
> appear to be same as closing the "transport" (see just above that where the
> two different terms are used).   It appears to only refer to closing the
> current TLS connection.
> I
> Nothing in section 7.2.2 suggests either the requirement to close the
> transport, nor the requirement to discard pending data in the transport
> connection.  I'm not arguing that implementations don't do exactly that
> though - I don't actually know.   if you're arguing that the standard says
> to close the transport and discard the pending TLS records, can you point
> me at that section?
>
> I also can't find anything that says that a new connection can't be opened
> on the same transport connection after a fatal close.
>
> So I would suggest that even with 7.2.2 you get this as an error case
> between a 1rtt TLS1.3 client and a 1.2 server:
>
> Client                                                      Server
> ClientKeyExchange ----->
> ClientHello ---->
>                                                            [Server notices
> data waiting on the transport
>                                                             Server begins
> a connection state
>                                                             Server
> receives and processes unexpected ClientKeyExchange
>                                                             Server sends a
> fatal alert and discards the connection state]
>                                        <--------------- Error Alert
> (unexpected_message) (plus close_notify??)
>  [Client receives the error alert
>    checks for type and discards it as expected]
>                                                            [Server notices
> data waiting on the transport
>                                                             Server begins
> a connection state
>                                                             Server
> Receives and processes ClientHello
>                                                             Server sends
> its part of a TLS1.2 handshake]
>                                         <--------------- ServerHello,
> ServerKeyExchange etc
> [Client receives the Server Side messages and processes
>   them...
>  Client resends the ClientKeyExchange that was ignored above]
> ClientKeyExchange  ------>
> etc --->
>  .............................  Continue through the normal connection
> process.
>
>
>
> From the server's side this looks like two different connections.  From
> the client side, it's just negotiating to the right suite.
>
> Mike
>
>
>
>
>  -Ekr
>
>
>> We could refine TLS 1.2 processing, of course, but if you were
>> expecting that to be backwards compatible with existing code then I
>> fear it won't work.
>>
>
>
>
>> Cheers
>>
>> AGL
>>
>> --
>> Adam Langley agl@imperialviolet.org https://www.imperialviolet.org
>>
>> _______________________________________________
>> TLS mailing list
>> TLS@ietf.org
>> https://www.ietf.org/mailman/listinfo/tls
>>
>
>
>