Re: [TLS] Curve25519 and TLS

Watson Ladd <watsonbladd@gmail.com> Thu, 26 June 2014 15:29 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 CE52E1B30A5 for <tls@ietfa.amsl.com>; Thu, 26 Jun 2014 08:29:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0
X-Spam-Level:
X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, 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 Th3mS2DzVkjX for <tls@ietfa.amsl.com>; Thu, 26 Jun 2014 08:29:30 -0700 (PDT)
Received: from mail-yh0-x22b.google.com (mail-yh0-x22b.google.com [IPv6:2607:f8b0:4002:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7E4D21B30A7 for <tls@ietf.org>; Thu, 26 Jun 2014 07:35:57 -0700 (PDT)
Received: by mail-yh0-f43.google.com with SMTP id a41so2157797yho.16 for <tls@ietf.org>; Thu, 26 Jun 2014 07:35:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LWBNTF9nSu2NuVMO54SIRjvn+krzdQBSrdkZoDWskhk=; b=nYICYKxIrphdFfYtdtGyv1yd0PrM+sPpvIv8Eb4x1QZ32/YNe7hHYPeNJrhsWvUVhW gjVWGsMN0kW2lJscDds1T1xXTAevmGQ9DekWIralM5NUcwQ/8q2alTBkJVXc0WzeZW4g MoemaUQxnV0nIYBpibWbj6Yik3eZZGvxsuWkmMsqrd/6XqPMma4MsMeZuq3tEljhl6m/ haTTKdXJlwh7jz8GibHfNQ14RuvtBtYdcGlgBuApDeaAxvz+ET19/COMhk2HYw+j33gi QqGiwzwvh8mueOwKCm77YSgC5T+dG8aIc40qKY6N1GSBpafLfZmePajuWmAYbqsqgE1P WHdA==
MIME-Version: 1.0
X-Received: by 10.236.134.169 with SMTP id s29mr22559325yhi.4.1403793356847; Thu, 26 Jun 2014 07:35:56 -0700 (PDT)
Received: by 10.170.39.136 with HTTP; Thu, 26 Jun 2014 07:35:56 -0700 (PDT)
In-Reply-To: <CADMpkc+S927gY20vwaqviGo2ULpPi1pBvrxYOv_e5ffUj7bJKg@mail.gmail.com>
References: <CACsn0cnm3wp6iN57fHAiY+=n=nSxOxvrZOj65bzXYTDy=Xyvkg@mail.gmail.com> <CADMpkc+S927gY20vwaqviGo2ULpPi1pBvrxYOv_e5ffUj7bJKg@mail.gmail.com>
Date: Thu, 26 Jun 2014 07:35:56 -0700
Message-ID: <CACsn0c=-BrTjvf2P+TmnGqJZrU0tn_oLoPqk7nmUm-+HkZfALg@mail.gmail.com>
From: Watson Ladd <watsonbladd@gmail.com>
To: Bodo Moeller <bmoeller@acm.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/IF4r9zb7poZ8QbF90BcBYMVsdNc
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [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: Thu, 26 Jun 2014 15:29:35 -0000

On Thu, Jun 26, 2014 at 1:18 AM, Bodo Moeller <bmoeller@acm.org> wrote:
> Watson Ladd <watsonbladd@gmail.com>:
>
>> 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.
>
>
> [...]
>>
>> The solution is to follow the advice on contributory behaviour and
>> disallow a fixed list of public keys, namely those of small order.
>
>
> Good point.  Given that the cofactor present in your secret key guarantees
> that you'll end up in a prime-order group (regardless of how the peer's
> input was chosen), I think you'd rather want to check the ECDH result
> instead of checking against that larger blacklist of public keys.
>
>> 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.
>
>
> Hm, this looks like something that rather belongs into the premaster secret
> => master secret step.  If you have this there (such as when you're using
> the proposed Extended Master Secret Extension
> [draft-bhargavan-tls-session-hash-00]), including the public keys here too
> would be redundant.  If you'd normally be doing a public-key check or an
> ECDH result check, you could just skip this check if the protocol no longer
> has a need for such protection.  In contrast, if you hash those additional
> inputs when computing the premaster secret, that's not something you could
> remove without affecting compatibility.

Yes, we could make EMSE a dependency of Curve25519. Or we could change
the way we compute
the PMS to avoid doing this: I proposed this solution because its very
simple for some implementations.

What do we gain from having the PMS calculated the same way for each curve?
>
> (On the flip site, of course, if an implementation omits a check that's
> necessary for security reasons in the protocol that you're using, you
> wouldn't normally notice interoperability problems as a result.  In
> contrast, if the protocol has those additional hash inputs, implementations
> couldn't get that wrong without failing to interoperate with others.
> However, there are many other more complex essential security checks that we
> trust implementations to get right, so the extra protocol complexity for
> this particular case doesn't seem warranted.)

This is a mistake in the design. Unfortunately I can't go into details
right now.

Sincerely,
Watson Ladd
>
> Bodo
>



-- 
"Those who would give up Essential Liberty to purchase a little
Temporary Safety deserve neither  Liberty nor Safety."
-- Benjamin Franklin