Re: [TLS] Verify data in the RI extension?

Martin Rex <mrex@sap.com> Fri, 27 November 2009 17:11 UTC

Return-Path: <mrex@sap.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 6E7DE3A6A42 for <tls@core3.amsl.com>; Fri, 27 Nov 2009 09:11:06 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.187
X-Spam-Level:
X-Spam-Status: No, score=-6.187 tagged_above=-999 required=5 tests=[AWL=0.062, BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-4]
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 HIADj1b1+FiU for <tls@core3.amsl.com>; Fri, 27 Nov 2009 09:11:04 -0800 (PST)
Received: from smtpde01.sap-ag.de (smtpde01.sap-ag.de [155.56.68.171]) by core3.amsl.com (Postfix) with ESMTP id 636993A6A2C for <tls@ietf.org>; Fri, 27 Nov 2009 09:11:04 -0800 (PST)
Received: from mail.sap.corp by smtpde01.sap-ag.de (26) with ESMTP id nARHAu3l007908 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Nov 2009 18:10:56 +0100 (MET)
From: Martin Rex <mrex@sap.com>
Message-Id: <200911271710.nARHAsu8008272@fs4113.wdf.sap.corp>
To: ekr@networkresonance.com
Date: Fri, 27 Nov 2009 18:10:54 +0100
In-Reply-To: <20091127161724.3DF546C37C8@kilo.networkresonance.com> from "Eric Rescorla" at Nov 27, 9 08:17:24 am
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Scanner: Virus Scanner virwal08
X-SAP: out
Cc: tls@ietf.org
Subject: Re: [TLS] Verify data in the RI extension?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: mrex@sap.com
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: Fri, 27 Nov 2009 17:11:07 -0000

Eric Rescorla wrote:
> 
> Woah, that's scary....
> 
> We're going to take the exact messages that previously appeared on the
> wire and inject them into the handshake hashes in order to *reduce*
> ambiguity in the hash input stream? I mean, maybe that's OK, but it
> sure isn't obviously OK.

A possible solution to avoid the ambiguity might look like the
following:

-Martin

ssl/s3_srvr.c:ssl3_send_server_hello()

    ret = ssl3_do_write(s,SSL3_RT_HANDSHAKE);
    if ( ret>0 ) {
        if ( s->s3->peer_is_updated || 0==s->s3->allow_old_renego ) {
            if ( s->s3->renegotiate ) {
                /* add previous Client.Finished to handshake msg hash */
                ssl3_finish_mac(s,s->s3->peer_finished,
                                  s->s3->peer_finished_len);
                /* add previous Server.Finished to handshake msg hash */
                ssl3_finish_mac(s,s->s3->finished,
                                  s->s3->finished_len);
            } else {
                /* add initial handshake msg hash differentiator */
                ssl3_finished_mac(s,"\x01\x55\xAA\x55", 4 );
            }
        }
        else
        {
            if ( s->s3->renegotiate ) {
                /* Servers SHOULD NOT offer old renegotiation anymore */
                /* if (0==(s->options&SSL_OP_ALLOW_INSECURE_RENEGOTIATE))*/
                ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_HANDSHAKE_FAILURE);
                ret = -1;
            }
        }
    }
    return(ret);