Re: [TLS] Quest for Unified Solution to TLS Renegotiation

Kyle Hamilton <aerowolf@gmail.com> Sat, 28 November 2009 11:22 UTC

Return-Path: <aerowolf@gmail.com>
X-Original-To: tls@core3.amsl.com
Delivered-To: tls@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 11F323A6807 for <tls@core3.amsl.com>; Sat, 28 Nov 2009 03:22:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.576
X-Spam-Level:
X-Spam-Status: No, score=-2.576 tagged_above=-999 required=5 tests=[AWL=0.023, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CHYNDW8NnT-D for <tls@core3.amsl.com>; Sat, 28 Nov 2009 03:22:25 -0800 (PST)
Received: from mail-pw0-f50.google.com (mail-pw0-f50.google.com [209.85.160.50]) by core3.amsl.com (Postfix) with ESMTP id D0E923A6783 for <tls@ietf.org>; Sat, 28 Nov 2009 03:22:25 -0800 (PST)
Received: by pwi6 with SMTP id 6so1449450pwi.29 for <tls@ietf.org>; Sat, 28 Nov 2009 03:22:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=YU937Czkx5Yldk3L1y9FSox9PSle41Sr3B8GVKyjib0=; b=mAU+6cOUWTMa4MpjNOJWTLtgcSQipsjQhrLB7udOHpcW5CJ/DHV0Q1JzfRY7UDMGyt y/jOXQaJ0ruEJbGnZaa1qsa9L4+VzFBUrOj7yg1GlWXFlSuO53fv+JUpHGQWrQIrgTqb GdJxBsC9kbohqW6eXyni0hLsrgJjclhoMoNyA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=rUvOqArVrqAjjLtap4fCFA5bSyBE5zFCHpIhzdym2UpYqYEXXuXFsL45BhH96sJIyU MGFKibiQqKhwG1b2zXtP6oDvueNhcPRfNctBP2T2Ttsdxc6zOmSX46YcvV23wPDyqRww C8w5D7aBZZiWhqdfRFqBC/6tSl7FfoYc9SvKw=
MIME-Version: 1.0
Received: by 10.143.27.31 with SMTP id e31mr214742wfj.173.1259407337467; Sat, 28 Nov 2009 03:22:17 -0800 (PST)
In-Reply-To: <20091125225408.42FB96C3288@kilo.networkresonance.com>
References: <4B0D9B94.9080205@pobox.com> <20091125225408.42FB96C3288@kilo.networkresonance.com>
Date: Sat, 28 Nov 2009 03:22:17 -0800
Message-ID: <6b9359640911280322w32974bd9u6b791ede79260d5c@mail.gmail.com>
From: Kyle Hamilton <aerowolf@gmail.com>
To: Eric Rescorla <ekr@networkresonance.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: TLS Working Group <tls@ietf.org>
Subject: Re: [TLS] Quest for Unified Solution to TLS Renegotiation
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
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/listinfo/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: Sat, 28 Nov 2009 11:22:27 -0000

On Wed, Nov 25, 2009 at 2:54 PM, Eric Rescorla <ekr@networkresonance.com> wrote:
>>    3) Incorporate previous verify_data into Finished calc.
>
> I'm not happy with this, actually.
>
> This requires breaking the current clean definition of handshake
> hashes as the hash of all the handshake messages and simply adding
> some synthetic message in the middle. I don't think this is anywhere
> near as clean, as evidenced by the ongoing debate about whether to put
> it the synthetic data in the front, the back, incorporate it into the
> PRF, or chain the pre-existing handshake messages. [FWIW, I think I
> prefer the last of these implicit versions.]

I would prefer to think in terms of "save the handshake hash values
after you verify them in Finished processing".  This would allow them
to be used as (essentially) initialization vectors for the next set of
handshake messages, thus providing "Message Authentication Code
continuity".  (The reason the attack works is because the server
doesn't properly authenticate the message, and the client can't know
that anything untoward happened.  The server doesn't chain any
information from the prior handshake into the current handshake, the
client doesn't chain any information from the prior handshake into the
current handshake, and there's no way for either the server or client
to tell the other exactly which negotiation epoch it thinks it's on.
If the prior handshake's information isn't chained in, from a security
standpoint it appears to be the same outcome as not verifying the MAC
on any given record.)  There shouldn't need to be any additional
verify_data sent, since all the information for ensuring that the same
client is talking with the same server is in those hashes.

So, potential ways to resolve this include:

1) including a 'negotiation epoch' in the handshake (if the server
thinks this is the first renegotiation, it's going to expect that the
epoch received from the client would be 1, not 0... and same for
subsequent negotiations).
2) Chain the last Finished hashes (NOT the master_secret or any key
material) as the initialization vector for the next handshake's
Finished MAC calculation.  (If you think about it, this is pretty much
the same as an epoch-based system, with each epoch 'named' by a
semi-random string of bits.)  Include the IV'd MAC as a field in the
Finished structure, and keep the current MAC calculation in place
(simply to simplify the lives of the vendors) -- which provides a
useful safety net: if they are the same, it's epoch 0, and if they're
not, it's not.

Now that we have some idea of how to authenticate the new session as
being an outgrowth of the prior, we now need to provide a means for
clients and servers that do this to notify each other that they're
using the modified handshake message algorithm.  We have on the table:

A) Secure Renegotiation Indicator TLS extension.
B) Magic cipher_suite.
C) Bit-fiddled version identifiers.

We are constrained by the following:

1) The mechanism for signalling must not screw up the protocol steps
for unpatched libraries.
2) The mechanism for signalling must be backward-compatible to SSLv3
(this is my interpretation of what the Area Director stated; please
correct me if I am wrong).

Because of constraint number 2, option A cannot be the mandated
mechanism for the client to signal the server that it supports
renegotiation continuity.  It is absolutely daft to try to turn an
integer into a bitfield, so option C is pretty much insane (and is
also fairly incompatible with DTLS, since its version is a
2s-complement of the TLS version it's based on).  This leaves option B
as the only sane mechanism that meets both constraints, for the client
to signal the server.

However, once the protocol is patched, it can be patched in any manner
the TLS group defines (and the TLS group has dominion over SSLv3, by
default, too).  So, the client's signal can tell the server that it's
okay to use a slightly different Finished message, no matter which
protocol version it's using -- one that includes a specific sequence
of bytes (a "magic number", if you will) after the end of the normal
Finished message.

Now, define the hash/PRF to have IVs of the prior iteration's Finished
hashes (each side has its own hash, so there's [a cryptographic
question: is there a reason to include both Finished hashes as IV
input to both the Server and the Client calculations?  Or should it be
sufficient to only include that side's prior hash?]  (the initial
vector for the first one is all bits clear), and you have a verifiable
chain of channel "ownership".

Am I misunderstanding the situation here?

> By contrast, RI allows that part of the system (which is well
> understood) to remain the same and in fact when RI is offered on the
> first handshake, there is no change to the TLS core at all. It's all
> just hashed into Finished as part of the ordinary TLS procedures,
> and everything is in fact compliant TLS, which I think is desirable.

The problem is this: all vendors -- not just a single vendor -- need
to be able to implement whatever's here *quickly*.  They need to do it
not just for TLS, but also for That Pre-TLS Protocol That Refuses To
Die.  There's no reason to change one in a manner that's incompatible
with the change made to the other.  (SSLv3 needs the magic cipher
suite, and that means that servers are going to have to support it if
they want to talk to even IE7 (which, IIRC, enabled SSLv3 but not
TLSv1.0).  SSLv3 ClientHello is still going to be used, and relying
only on an RI extension fails to support it.  Thus, it's pretty much a
non-starter.

As the Area Director has stated, the IETF is in this to ensure that
the network *works*, not to adhere to some ideologically 'pure'
concept.  SSLv3 is, unfortunately, going to have to be supported --
because if we suddenly break 75% of the clients on the network, not
only the users but IT admins and CTOs alike are going to be *pissed*.

An "unsolicited" empty RI extension from the server when it sees the
magic cipher_suite is probably the cleanest way to insert the
signalling required for any defense against the attack to work... the
server would not send it unless the client sent the magic ciphersuite
(or, following the TLS Extensions model, if the client offered it as
an extension during negotiation).  An unpatched server won't send the
RI extension even if the client sends the magic cipher_suite, so the
client should know not to renegotiate.  An unpatched client won't send
either the magic cipher_suite or the RI extension, so the server
should know not to renegotiate (and thus won't send the RI extension
-- again following the extensions model, with an addendum that the RI
extension is the only one that can be requested with a magic
cipher_suite being prepended to the actual list of ciphers that the
client's willing to use).

> I appreciate that this is to some extent a matter of tradeoffs,
> but I don't find the arguments in favor of the implicit version
> very compelling when weighed against the above.

"Implicit version"?  There is no "implicit version" in the
Moeller/D'Errico proposal.  The version structure is never touched at
all.

-Kyle H