Re: [TLS] weird ECDSA interop problem with cloudflare/nginx

Hubert Kario <hkario@redhat.com> Tue, 26 July 2016 14:21 UTC

Return-Path: <hkario@redhat.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 429C712DDE1 for <tls@ietfa.amsl.com>; Tue, 26 Jul 2016 07:21:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.189
X-Spam-Level:
X-Spam-Status: No, score=-8.189 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-1.287, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 1Z0ILNM6DtFw for <tls@ietfa.amsl.com>; Tue, 26 Jul 2016 07:21:23 -0700 (PDT)
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9C3B412DDE6 for <tls@ietf.org>; Tue, 26 Jul 2016 07:01:18 -0700 (PDT)
Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB4908B11B; Tue, 26 Jul 2016 14:01:17 +0000 (UTC)
Received: from pintsize.usersys.redhat.com (dhcp-0-107.brq.redhat.com [10.34.0.107]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u6QE1Fu9005714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Jul 2016 10:01:17 -0400
From: Hubert Kario <hkario@redhat.com>
To: tls@ietf.org
Date: Tue, 26 Jul 2016 16:01:15 +0200
Message-ID: <14000022.JQvKyvFqq9@pintsize.usersys.redhat.com>
User-Agent: KMail/5.2.3 (Linux/4.6.4-301.fc24.x86_64; KDE/5.24.0; x86_64; ; )
In-Reply-To: <20160726120833.GL4670@mournblade.imrryr.org>
References: <05880081-C790-4D4C-9FF0-BA29F47C010A@dukhovni.org> <20160726100904.GA24234@LK-Perkele-V2.elisa-laajakaista.fi> <20160726120833.GL4670@mournblade.imrryr.org>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart2730809.OUEuMdJQlU"; micalg="pgp-sha512"; protocol="application/pgp-signature"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 26 Jul 2016 14:01:18 +0000 (UTC)
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/kk0s2HwPUPTba4-tu9wpRsiNvqQ>
Subject: Re: [TLS] weird ECDSA interop problem with cloudflare/nginx
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.17
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: <https://mailarchive.ietf.org/arch/browse/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: Tue, 26 Jul 2016 14:21:36 -0000

On Tuesday, 26 July 2016 12:08:33 CEST Viktor Dukhovni wrote:
> On Tue, Jul 26, 2016 at 01:09:04PM +0300, Ilari Liusvaara wrote:
> > > Failure:
> > > openssl s_client -connect regmedia.co.uk:443 -cipher
> > > ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305> 
> > If you swap the order of these two ciphersuites, does it suceed or fail?
> > 
> > I.e.
> > 
> > openssl s_client -connect regmedia.co.uk:443 -cipher
> > ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256
> I can reproduce the reported failure in the original order, and at
> least for me the swapped variant succeeds.
> 
> > Well, your test results certainly blow basic "negotiation accidentially
> > blows off all valid candidates and then fails" hypothesis out of the
> > water. So it has to be soemthing more complicated.
> > 
> > Succeeding with the ciphersuites swapped would suggest (as somebody
> > else in this thread already said) that it only considers Chacha in
> > the first place, not noticing that it may be the only choice after
> > certificate selection.
> 
> Perhaps that's the issue.

if you send the AES-GCM then Chacha but do NOT include signature algorithms, 
it allows you to connect (other extensions are irrelevant).

If you send AES-GCM then Chacha in ciphers but in signatures algorithms don't 
include the SHA256/ecdsa pair, it works too.

in other words, this connects:
openssl s_client -connect regmedia.co.uk:443 -cipher ECDHE-RSA-AES128-GCM-
SHA256:ECDHE-ECDSA-CHACHA20-POLY1305 -sigalgs ECDSA+SHA512:RSA+SHA256

and this connects:
openssl s_client -connect regmedia.co.uk:443 -cipher ECDHE-RSA-AES128-GCM-
SHA256:ECDHE-ECDSA-CHACHA20-POLY1305 -sigalgs ECDSA+SHA512:RSA+SHA512

but this doesn't:
openssl s_client -connect regmedia.co.uk:443 -cipher ECDHE-RSA-AES128-GCM-
SHA256:ECDHE-ECDSA-CHACHA20-POLY1305 -sigalgs ECDSA+SHA256:RSA+SHA256

(using openssl-1.1.0-pre5)
-- 
Regards,
Hubert Kario
Senior Quality Engineer, QE BaseOS Security team
Web: www.cz.redhat.com
Red Hat Czech s.r.o., Purkyňova 99/71, 612 45, Brno, Czech Republic