[TLS] Curve25519 and TLS

Watson Ladd <watsonbladd@gmail.com> Fri, 13 June 2014 21:30 UTC

Return-Path: <watsonbladd@gmail.com>
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 A65391B2A5D for <tls@ietfa.amsl.com>; Fri, 13 Jun 2014 14:30:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.4
X-Spam-Level:
X-Spam-Status: No, score=-1.4 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, J_CHICKENPOX_12=0.6, SPF_PASS=-0.001] autolearn=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 E-XbQsXKksHY for <tls@ietfa.amsl.com>; Fri, 13 Jun 2014 14:30:48 -0700 (PDT)
Received: from mail-yh0-x233.google.com (mail-yh0-x233.google.com [IPv6:2607:f8b0:4002:c01::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DDCF91B2A59 for <tls@ietf.org>; Fri, 13 Jun 2014 14:30:47 -0700 (PDT)
Received: by mail-yh0-f51.google.com with SMTP id f10so2600371yha.38 for <tls@ietf.org>; Fri, 13 Jun 2014 14:30:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=GTZu3n6B12hl4TwzHbudfxhL5z70Izr+s9bK0Bg10XY=; b=D36V2DBAjsq16DW1bjL3PZYfT67GLA+zr26LVdEuF55Nt4eDoHugzpt4wlxs7kywWg GvnW0NkYOCKS5mH6qqlleQ6Whefm+Dc6mnXubjZ5T/Cbk87hZc2p4eVVLM9MVXOdLzPm hxrI041SDD9co2EqD2c+t+0HxvuVtwItlHc1u2W+CZf287qgqYia/bhJg+wwh+P6nNfE adiovAvxnIwS0pUfDU0V8N1MQ/b6OTJvaHlC8GgjofY7qsDDxlgn8XjzEcDHS0cysHi5 daOhUQzwwWmxZvait0EijpnsnXkpJz+sCHk47Fk17EMqxMC8Jrmrl0SAnC2BRYz+NFwo p2rw==
MIME-Version: 1.0
X-Received: by 10.236.74.33 with SMTP id w21mr8056075yhd.87.1402695047179; Fri, 13 Jun 2014 14:30:47 -0700 (PDT)
Received: by 10.170.39.136 with HTTP; Fri, 13 Jun 2014 14:30:46 -0700 (PDT)
Date: Fri, 13 Jun 2014 18:30:46 -0300
Message-ID: <CACsn0cnm3wp6iN57fHAiY+=n=nSxOxvrZOj65bzXYTDy=Xyvkg@mail.gmail.com>
From: Watson Ladd <watsonbladd@gmail.com>
To: "tls@ietf.org" <tls@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/_r7C6QZumy85LRfmZ3NWFVAnwHw
Subject: [TLS] Curve25519 and TLS
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: Fri, 13 Jun 2014 21:30:48 -0000

Dear all,

TLS with ECC computes the premaster secret as H(abg) where g is the
generator of the group, and a and b are the ephemeral exponents.
Because of protocol weaknesses, this premaster secret must be
"contributory": neither side can be allowed to dictate it.

Curve25519 has order 8*q, where q is some prime. All encoded public
keys lie on this or a twist with order 4*q'. (I might be wrong in the
details, but it's right enough). In particular there is a point of
order 2.

A malicious server can provide a point of order 2, and with 50%
probability get a dictated premaster secret.

The solution is to follow the advice on contributory behaviour and
disallow a fixed list of public keys, namely those of small order.
Alternatively we can compute the premaster secret as the hash of H(ag
| bg | abg): I have not yet confirmed that this solves the problem.

For TLS 1.3 we should ensure contributory behaviour is not required to
avoid these issues.

Sincerely,
Watson Ladd