Re: [TLS] xLS 1.3: cookie

Eric Rescorla <ekr@rtfm.com> Wed, 29 March 2017 14:30 UTC

Return-Path: <ekr@rtfm.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 5D537129533 for <tls@ietfa.amsl.com>; Wed, 29 Mar 2017 07:30:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.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 MTi0Z-xuipzJ for <tls@ietfa.amsl.com>; Wed, 29 Mar 2017 07:30:41 -0700 (PDT)
Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::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 178CD129474 for <tls@ietf.org>; Wed, 29 Mar 2017 07:30:40 -0700 (PDT)
Received: by mail-yw0-x22f.google.com with SMTP id d191so11799143ywe.2 for <tls@ietf.org>; Wed, 29 Mar 2017 07:30:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=O/pGkOnFN3qYbL9AQZRQj2NQ/Alncqq2X6cOQ5ef+fE=; b=1VNtmTIHTZLPS+B9BaRAX/iGPmaVGiVaDuG3RbVeVjTA1kb71M44NSwKz8Z5S3P31T eh7tt8ak5QiXGfB8zyHwpfb9KMk0sY8lIXoGheWHrO1pNKamfRv7DffblcsJY3eeBS9X aadtuceOFEYqguGFh1kY+6TCuQzCQVriUyJV4MIBCOlQWjU/h4cdqdWd1cuJ2h/iCRZ9 bpHTxCKH9GDdVek5fHXtELwUvuf87UqS27MkK6XVFQZ4jQn9QfaFwZHfCpmkk3tLGX7Q Lm0HzU+2tncxu5q9ZOhlOLRC5HHHoszg5kBIJ+1s8sSiz3uLyIBK3jsQA7MXr9JWwbvz FmXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=O/pGkOnFN3qYbL9AQZRQj2NQ/Alncqq2X6cOQ5ef+fE=; b=gUqAjGcpOA9CAQQrMT4tHcsBWxGoYWKAK4PNJQ1jD4JNOJhh+UIHS7QxDjS8FWqzMV ntjA/sIb4r6GhrZ201ovx43hlQeOPj3RDm6bOkNnRD0pCxtMiBrEYX1EsdKzGuiL6Aup ZZ/vmceGNCyjSn2Lnw0DGgxCEGeSWCQ/7Tr/kFETkfOvBVo2rEB1MY6MZaWDqdKbrUy1 c0w4V51NRkWFzRnH0Jk+w1mNEEhBG1G3+6Wgwz8SEhOXA1Jt1FmMO6trj1yWlspD4GSM J7Z/efc3bWrp7B94spzR74RlucLQwY7U17tYyhD7rydbawxBuq72Geiq4L/qr0NYrZQm mvCQ==
X-Gm-Message-State: AFeK/H2MU745bU1VqCI2WLnYmrQo2EYRqcreeAea1EmTnLLZploI6vfpzXO7gXA8SgYenXXRxsomCxA3UJuiVQ==
X-Received: by 10.129.108.214 with SMTP id h205mr670762ywc.71.1490797839141; Wed, 29 Mar 2017 07:30:39 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.154.210 with HTTP; Wed, 29 Mar 2017 07:29:58 -0700 (PDT)
In-Reply-To: <16998c3d-4de6-7c88-d8a3-6d6193326500@objectiveintegration.uk>
References: <16998c3d-4de6-7c88-d8a3-6d6193326500@objectiveintegration.uk>
From: Eric Rescorla <ekr@rtfm.com>
Date: Wed, 29 Mar 2017 09:29:58 -0500
Message-ID: <CABcZeBMcz8A=Q7E2d6iu2p-uajPoPFDDECBaFfXuQyZgSsEa4A@mail.gmail.com>
To: Mark Dunn <mark.dunn@objectiveintegration.uk>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="001a114e81dca279d6054bdf6bc8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/9egoT2xWH1RPSZWasU-PiEHVCF8>
Subject: Re: [TLS] xLS 1.3: cookie
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: Wed, 29 Mar 2017 14:30:43 -0000

Hi Mark,

Thanks for your note. Some comments below...


On Wed, Mar 29, 2017 at 8:10 AM, Mark Dunn <
mark.dunn@objectiveintegration.uk> wrote:

> I am trying to implement cookie and finding it a little underspecified.
>
>     I am using the TLS 1.3 specified in github and
> draft-rescorla-tls-dtls13-01
>
>
> 1a)    Should a client expect to respond to a cookie during session
> resumption?
>

Yes, it has to be ready to. As you say, it kills 0-RTT, but that's how HRR
always behaves.




>
> 1b)    If (1a) is false then do you agree that the "cookie" extension MUST
> be accompanied by the "key_share" extension? Otherwisewe might be faced with
>
>     ClientHello
>
>     +key_share
>
>     +... ----->
>
> HelloRetryRequest
>
>                       <-----+cookie
>
>     ClientHello
>
>     +cookie
>
>     +key_share
>
>     +...               ----->
>
> HelloRetryRequest
>
> <-----   +key_share
>
>     ClientHello
>
>     +key_share
>
>     +...        ----->
>
>                                 ServerHello
>
>                                 +key_share
>
>                                 +...
>

If I understand you correctly, then I think this is wrong. You only send
key_share to correct
the client's key_share, so if the client sent a key_share but you send
cookie to force
a round-trip, then you don't send key_share, just cookie.





> 2)    I understand this is too late for TLS(only DTLS SHOULD use cookies)
> but is there a better solution than a cookie?
>

This seems like it would be a big restructure of the handshake, and given
the
relatively modest use of client auth in many contexts, I don't think it
would probably
be worth it.

Best,
-Ekr




> For authenticatedclients a botnet DOS attack could be mitigated by
> authenticating the clientfirst.
>
> In the worst case where the client provided an unacceptable key_share the
> Server would have to provide
>
>     ClientHello // flight 1
>
>     +key_share
>
>     +signature_algorithms
>
>     +supported_groups
>
>     +...                ----->
>
>                                 HelloRetryRequest // flight 2
>
>                                 +cookie // from DTLS 1.2: HMAC(secret,
> Client-IP, Client-Parameters)
>
>                                 +key_share(server_share)
>
>                                 +signature_algorithms // not required as
> supplied by client
>
>                                 +supported_groups // not required as
> supplied by client
>
>                         <-----  {CertificateRequest}      // implied when
> key_share(server_share) is used
>
>     ClientHello   // flight 3
>
>     +key_share
>
>     +cookie // this may provide state information to the server
>
>     +...
>
>     {Cetrificate}
>
>     {CertificateVerify}
>
>     {finished} // provides reachability for the client first and is
> protected by server_handshake_traffic_secret
>
>     [application data]  ----->     // protected using keys derived from
> traffic_secret_N
>
>                                 ServerHello // flight 4
>
>                                 {EncryptedExtensions}
>
>                                 {Certificate}
>
>                                 {CertificateVerify}
>
>                                 {Finished} // provides reachability for
> the server
>
>                         <-----  [application data]
>
>
>
> For authenticating clients, this would provide better defense against DOS,
> DOS amplification and require fewer round trips.
>
>
>
>
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>