Re: [TLS] I-D Action: draft-ietf-tls-negotiated-ff-dhe-02.txt

Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Mon, 27 October 2014 12:10 UTC

Return-Path: <ilari.liusvaara@elisanet.fi>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B1EF81A9238 for <tls@ietfa.amsl.com>; Mon, 27 Oct 2014 05:10:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham
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 gD5SrlcKwUEj for <tls@ietfa.amsl.com>; Mon, 27 Oct 2014 05:10:50 -0700 (PDT)
Received: from emh03.mail.saunalahti.fi (emh03.mail.saunalahti.fi [62.142.5.109]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1124C1A9236 for <tls@ietf.org>; Mon, 27 Oct 2014 05:10:16 -0700 (PDT)
Received: from LK-Perkele-VII (a88-112-44-140.elisa-laajakaista.fi [88.112.44.140]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 3168B1887E6; Mon, 27 Oct 2014 14:10:12 +0200 (EET)
Date: Mon, 27 Oct 2014 14:10:12 +0200
From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
To: Nikos Mavrogiannopoulos <nmav@redhat.com>
Message-ID: <20141027121012.GA10631@LK-Perkele-VII>
References: <20141011044948.27553.93984.idtracker@ietfa.amsl.com> <5438B82B.6090600@fifthhorseman.net> <544BD3BF.9030702@streamsec.se> <1682594903.63043.1414266713793.JavaMail.zimbra@redhat.com> <544C1BC3.5060204@streamsec.se> <1749574094.84536.1414307373087.JavaMail.zimbra@redhat.com> <544E0682.30804@streamsec.se> <1414405551.2543.8.camel@dhcp-2-127.brq.redhat.com> <544E254A.3020501@streamsec.se> <1414408020.2543.13.camel@dhcp-2-127.brq.redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <1414408020.2543.13.camel@dhcp-2-127.brq.redhat.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
Sender: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/7zUqrgB4N-LrRnoH-t-dY2pPUQc
Cc: tls@ietf.org
Subject: Re: [TLS] I-D Action: draft-ietf-tls-negotiated-ff-dhe-02.txt
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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, 27 Oct 2014 12:10:58 -0000

On Mon, Oct 27, 2014 at 12:07:00PM +0100, Nikos Mavrogiannopoulos wrote:
> On Mon, 2014-10-27 at 11:58 +0100, Henrick Hellström wrote:
> >
> > FWIW, the real problem here is RFC 4492. There was no ambiguity in TLS 
> > 1.0, because the ServerKeyExchange could only contain two kinds of 
> > messages, one with two large integers (a ServerRSAParams) or one with 
> > three large integers (a ServerDHParams). RFC 4492 introduced the 
> > ambiguity. Can anyone think of a way to fix it, without forcing Named 
> > FFDHE compatible servers to negotiate RSA cipher suites instead of DHE 
> > cipher suites with legacy clients? Is that even a good idea? (That was a 
> > rhetorical question.)
> 
> A way to fix that for the ffdhe draft would be to introduce a two-byte
> type that is on purpose large (eg. values like 0xff 0xfa).

Basically, you want to:
1) ECDHE SKE to not be interpretable as FFDHE SKE.
2) FFDHE SKE to blow up when interpretted as ECDHE SKE.
3) FFDHE SKE to blow up when interpretted as DHE SKE (including legacy software).


If the first byte of FFDHE SKE has to be 00, that takes care of 1) and 2),
because first byte of ECDHE SKE is the curve type, and curve type 0 is
not valid.

3) Is nastier issue. AFAICT, with such misinterpretation, not even session_hash
will save you.

One way (not necressarily good) would be to encode ServerDHParams as
00 01 00 NOT(grpid). If one tries to parse this as DHE, one gets p=0 and length
of g being ~65,000 bytes (pretty certainly overflowing the message).


-Ilari