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

David-Sarah Hopwood <david-sarah@jacaranda.org> Thu, 26 November 2009 05:15 UTC

Return-Path: <djhopwood@googlemail.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 D06D93A6903 for <tls@core3.amsl.com>; Wed, 25 Nov 2009 21:15:45 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[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 Aq1agTX1chBY for <tls@core3.amsl.com>; Wed, 25 Nov 2009 21:15:44 -0800 (PST)
Received: from mail-ew0-f214.google.com (mail-ew0-f214.google.com [209.85.219.214]) by core3.amsl.com (Postfix) with ESMTP id 21D993A69BE for <tls@ietf.org>; Wed, 25 Nov 2009 21:15:43 -0800 (PST)
Received: by ewy6 with SMTP id 6so431976ewy.29 for <tls@ietf.org>; Wed, 25 Nov 2009 21:15:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=Cw5Gk2MQ0jowKaX6RGoJ5C4Pd689zkpjCDPCIkcIC3M=; b=cdzFEtHi8+yDz+wVvOsL40RoThfUYLA9p+DJDLExF4TdcW3wKESEVCGvoFKm57YGZU ejKA8N0jS4ShPIiq2mrOkO1qDPF71jrQpzpmAEyOTKJybdSGsDo5dkGo6jsz7R3PutZU GrtnzOFcPnR7SH7Z3tlqS8ha+7BGUIBhu8W+U=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; b=tlAIvyEmMtEGG+vHXCd2u9eMi2duJdMLERRWwXCQOiFm6eoYUomCtwMpbb3anfH3IY o4eXGRomfhF81e7h+0RRJCV3R00EBRoWsZD3RlxA2IO1Rkvc53PP36+sKX2VZ6Tnnmmj 0dW8q6utBphQ9+nrgPrg5oAeT99nwfp/UpSwk=
Received: by 10.216.86.193 with SMTP id w43mr155754wee.17.1259212534580; Wed, 25 Nov 2009 21:15:34 -0800 (PST)
Received: from ?192.168.0.2? (5adcc5d2.bb.sky.com [90.220.197.210]) by mx.google.com with ESMTPS id 28sm4042941eye.7.2009.11.25.21.15.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 25 Nov 2009 21:15:33 -0800 (PST)
Sender: David-Sarah Hopwood <djhopwood@googlemail.com>
Message-ID: <4B0E0EF4.7000102@jacaranda.org>
Date: Thu, 26 Nov 2009 05:15:32 +0000
From: David-Sarah Hopwood <david-sarah@jacaranda.org>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 Mnenhy/0.7.5.666
MIME-Version: 1.0
To: tls@ietf.org
References: <4B0D9B94.9080205@pobox.com>
In-Reply-To: <4B0D9B94.9080205@pobox.com>
X-Enigmail-Version: 0.96.0
Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="------------enigC9D70B015DC09DA69DB5E3A4"
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: Thu, 26 Nov 2009 05:15:45 -0000

Michael D'Errico wrote:
> I think that it would be good to find a unified solution that
> everybody is happy with, and believe that this may be it:
> 
> 
>   1) Client-to-Server signalling can be done in either of
>      two ways:
> 
>      A) an empty Secure_Renegotiation (SR) extension, or
>      B) a "magic" cipher suite
> 
>   2) Server-to-Client signal is always an empty SR extension
> 
>   3) Incorporate previous verify_data into Finished calc.
> 
> 
> The particulars:
> 
> A client that currently sends any other extensions MUST also
> send the empty SR extension.
> 
> A client that currently does not send any extensions MAY send
> the empty SR extension, or MAY send the magic cipher suite.
> 
> In response to either 1A or 1B, the server responds with an
> empty SR extension.  The only ugliness is this apparently-
> unsolicited extension returned by the server in response to
> the magic cipher suite.  I used to be against this, but have
> since decided that it is no more ugly than flipping a version
> bit or any of the other ideas.

I fully support this approach. The extension is not really
"unsolicited" in this case.

> It remains to be decided if adding the verify_data to the
> handshake message stream is the right way to do (3), or if
> changing the PRF in some way is better, such as changing the
> seed to be the handshake message hash appended with the old
> verify_data, or some other method.

I previously argued for changing the use of the PRF in the Finished
computation, mainly in order to ensure that the possible PRF inputs
for modified and unmodified Finished computations would be disjoint.
However, that would have the disadvantage (pointed out by Bodo Möller)
that the data signed in any CertificateVerify message wouldn't include
the old verify_data, unless that were also explicitly changed.

The old verify_data should not just be appended to the handshake_messages
without any further encoding, though, because it might match the bytes
of some valid handshake message. In that case, there is the possibility
that a MITM might insert the old verify_data into the stream sent to
one peer, as though it were a handshake message. If that peer is using
the unmodified Finished computation (either because it is unpatched or
it is doing an initial handshake), then it may end up computing the same
Finished hash as the other peer that is using the modified computation.

I haven't gone through the details of this attack thoroughly enough
to be sure it will work, but it is too near working for comfort.

So, we could either:

1. Change the use of the PRF and also change CertificateVerify (if
   used):

    verify_data =
      PRF(master_secret, finished_label, Hash(handshake_messages)
                                         + previous_verify_data)
        [0..verify_data_length-1];

    struct {
        digitally-signed struct {
            opaque handshake_messages[handshake_messages_length];
            switch (is_renegotiation) {
              case false:
                  struct {};
              case true:
                  opaque previous_verify_data[previous_verify_data_length];
            };
        }
    } CertificateVerify;

2. Add the old verify_data to handshake_messages preceded by the encoding
   of a fatal alert. Then, attacks of the kind described above can't work
   because the unpatched peer would first process the alert and abort the
   handshake.

-- 
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com