Re: [TLS] Final (hopefully) issues with DTLS 1.2

Eric Rescorla <ekr@rtfm.com> Mon, 30 May 2011 15:38 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 3FBBAE07ED for <tls@ietfa.amsl.com>; Mon, 30 May 2011 08:38:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.977
X-Spam-Level:
X-Spam-Status: No, score=-102.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-1, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rVXpnZWZiZaJ for <tls@ietfa.amsl.com>; Mon, 30 May 2011 08:38:42 -0700 (PDT)
Received: from mail-wy0-f172.google.com (mail-wy0-f172.google.com [74.125.82.172]) by ietfa.amsl.com (Postfix) with ESMTP id 73996E07E7 for <tls@ietf.org>; Mon, 30 May 2011 08:38:42 -0700 (PDT)
Received: by wyb29 with SMTP id 29so3190661wyb.31 for <tls@ietf.org>; Mon, 30 May 2011 08:38:41 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.232.23 with SMTP id m23mr4953445weq.26.1306769921510; Mon, 30 May 2011 08:38:41 -0700 (PDT)
Received: by 10.216.161.147 with HTTP; Mon, 30 May 2011 08:38:41 -0700 (PDT)
In-Reply-To: <4DDA70B6.9030203@gnutls.org>
References: <BANLkTikjMZpYm4Maef1wqnmH4RJ02-6t1g@mail.gmail.com> <4DDA70B6.9030203@gnutls.org>
Date: Mon, 30 May 2011 08:38:41 -0700
Message-ID: <BANLkTi=M2-qAmcDYb0zxucXFkaLgV+3KGQ@mail.gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
To: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
Cc: tls@ietf.org
Subject: Re: [TLS] Final (hopefully) issues with DTLS 1.2
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: Mon, 30 May 2011 15:38:44 -0000

On Mon, May 23, 2011 at 7:35 AM, Nikos Mavrogiannopoulos
<nmav@gnutls.org> wrote:
> On 05/23/2011 03:19 PM, Eric Rescorla wrote:
>
> Hello,
>
>> Record Sequence Number: When responding to a HelloVerifyRequest the
>> client MUST use the same parameter values (version, random,
>> session_id, cipher_suites, compression_method) as it did in the
>> original ClientHello.  The server SHOULD use those values to generate
>> its cookie and verify that they are correct upon cookie receipt.  The
>> server MUST use the same version number in the HelloVerifyRequest
>> that it would use when sending a ServerHello. Upon receipt of the
>> ServerHello, the client MUST verify that the server version values
>> match. In order to avoid
>
> What is the rationale of this restriction?

 Given my points in
> http://permalink.gmane.org/gmane.ietf.tls/8336
> I believe interoperability will be harmed in the future as ciphersuites
> are being deprecated or restricted to certain protocols.

I'm not sure I'm following this concern.

The effect of this restriction is to require the client to send the
same ClientHello
(except with the cookie that he sent initially). This maps to the TLS semantics
where there is only a single ClientHello message sent which is processed
immediately. IMO this makes analysis easier since it makes DTLS behave
more like TLS.

There's no need for the server to do any negotiation at this point,
it should simply generate a HelloVerifyRequest with the highest matching
version (regardless of cipher suite considerations) and then process the
ClientHello de novo [after checking for matching parameters.] Yes, this leaves
open the possibility that the handshake will eventually negotiate to some yet
lower TLS version, but that's what happens in one round trip with TLS. I
would be happy to add a note to the effect that a yet lower version might
be negotiated. Though note that it's arguable that RFC 5246 S 7.4.1.3
prohibits conditioning version on ciphersuite even for TLS "This field
will contain the lower of that suggested by the client
in the client hello and the highest supported by the server.  For this
version of the specification, the version is 3.3.  (See
Appendix E for details about backward compatibility.)"




>> Finally, I've been rethinking the issue of the interaction of the
>> ChangeCipherSpec and the handshake sequence numbers. In Prague I
>> suggested not changing this and just putting a note in the spec that
>> one had to be careful, but at this point I am thinking it might be
>> better to simple suck up the change and put a message sequence
>> number in the CCS. This removes the need to consult the handshake
>> state machine in order to deal with reordering, though not in order
>> to determine whether the CCS is at the appropriate place in the
>> handshake (in order to detect misbehaving or malicious behavior
>> early).  The downside for this is that it's a difference from TLS,
>> but it seems like fairly easy code--though I admit I haven't tried to
>> code it up. I don't think either way represents a security issue, but
>> doing it this way means that we won't need to be as careful in the
>> future about having the state machine be completely deterministic
>> prior to the CCS, which seems like the Right Thing. Comments?
>
> Which use-case are you trying to solve? Could an implementation solve
> it using another way (what being careful would mean?).

It's less an implementation issue than a spec issue. Currently the
order of the handshake messages vis-a-vis the CCS is deterministic,
i.e., that you know in advance what set of handshake messages you
ought to have received before receiving the CCS. However, if future
specs were to break this invariant, then you would be left in a position
where you had the CCS but weren't sure if you were expecting another
handshake message, so couldn't necessarily process the CCS.


> A change like that to changecipherspec is not that trivial as it
> actually convert it from a signaling message to a handshake message
> (e.g. in my implementation changecipherspec is not parsed by the
> handshake layer).

Yes, I realize this isn't great. IMO it was a mistake for the CCS not to be
a handshake message, but we can't really fix that.... we're left with
trying to determine the lesser of two evils.

Best,
-Ekr