Re: [TLS] Renegotation redux

Watson Ladd <watsonbladd@gmail.com> Tue, 15 April 2014 06:14 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 369D91A033C for <tls@ietfa.amsl.com>; Mon, 14 Apr 2014 23:14:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.7
X-Spam-Level:
X-Spam-Status: No, score=0.7 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 KNju51V6jzuK for <tls@ietfa.amsl.com>; Mon, 14 Apr 2014 23:14:18 -0700 (PDT)
Received: from mail-yk0-x22a.google.com (mail-yk0-x22a.google.com [IPv6:2607:f8b0:4002:c07::22a]) by ietfa.amsl.com (Postfix) with ESMTP id 6F99E1A008B for <tls@ietf.org>; Mon, 14 Apr 2014 23:14:18 -0700 (PDT)
Received: by mail-yk0-f170.google.com with SMTP id 9so8537172ykp.29 for <tls@ietf.org>; Mon, 14 Apr 2014 23:14:15 -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=RY7PGWMLb7zHz7c+tWt0G5AmXBFoEsRYSYbwMEh83tw=; b=aCZgER2+31uSzEaammso1srWdrg258MFZq0MnALRD869QryzWFLP0NKQk2gzjVBCBz KG5WVzKTY5EYf3hy7lDNxp/OiLRjvUnxMoIkot/zMAKRXEUHvepJY8KPggmZfdnNoJdq y8zr3g1YbeaIDxCLu+b50BZZJbxAPTxSB3ePQdes+TWiMvEkZ5Lz257isYGRuEc13ym9 tsW/vYFTNTMGAW6u8saCYoGuhc0Bt4i16/1lx3NSh9N9TKjO4dX14BCrlrbe4tmUzelZ muYV4vy790TD3zjpEz8LdLZPuxGL3lOkUQGUcrFdWNqseI2PZn0s2Qpv+N76vjaB6TAa NzYw==
MIME-Version: 1.0
X-Received: by 10.236.137.8 with SMTP id x8mr20698yhi.4.1397542455568; Mon, 14 Apr 2014 23:14:15 -0700 (PDT)
Received: by 10.170.63.197 with HTTP; Mon, 14 Apr 2014 23:14:15 -0700 (PDT)
In-Reply-To: <CAK3OfOiGnP_tDUqrQAONHbsKsKbZtfgASgQogV3jjFWM0Epghg@mail.gmail.com>
References: <CACsn0c=mLgKor7PLPG0PNMYqJP9bDD1yfVeCzM0yUFwnkgMQXg@mail.gmail.com> <CAK3OfOiGnP_tDUqrQAONHbsKsKbZtfgASgQogV3jjFWM0Epghg@mail.gmail.com>
Date: Mon, 14 Apr 2014 23:14:15 -0700
Message-ID: <CACsn0cnAvZyN7H+GJatze6eE_12K9RmwYVL02Vv8jZ7QzpGTLQ@mail.gmail.com>
From: Watson Ladd <watsonbladd@gmail.com>
To: Nico Williams <nico@cryptonector.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/bYEzyvqQAjYWy5uf88NLT9mJO8E
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Renegotation redux
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: Tue, 15 Apr 2014 06:14:23 -0000

On Mon, Apr 14, 2014 at 9:36 PM, Nico Williams <nico@cryptonector.com> wrote:
> On Mon, Apr 14, 2014 at 9:48 AM, Watson Ladd <watsonbladd@gmail.com> wrote:
>> Are there any users of renegotiation beyond authentication with client
>> side certificates? In particular has anyone come up with a use for
>> changing the claimed identity of the server?
>
> Yes, it's been discussed in the context of protecting the server's
> identity: start with anon ECDHE ciphersuites then renegotiate to [use
> SNI and] authenticate the server.

That won't work if you do it like that. Hint: how does the server know
who to reveal their identity to?

>
> This is important in general given that privacy protection is desirable.
>
>> I think we can do client authentication upgrades via a channel
>> extraction+signing solution while preserving the privacy currently
>
> We call that channel binding.  I agree as to that.
>
>> given by renegotiation. I haven't yet run Proverif on this solution,
>> so it might not work, but my intuition is that this will work better
>> than trying to expose the semantics of renegotiation correctly.
>>
>> Renegotation has been responsible for two major security issues, and
>> significantly complicates the TLS handshake state machine and
>> semantics.
>
> First off, renego was responsible for one bug -- the other is a
> resumption bug, and BOTH were the result of insufficient or
> non-existent channel binding between the one connection and the other.

It's not "a lack of channel binding". It's a failure to hash
transcripts in a key exchange. That's why you can have the same
pre-master secret on two different connections, and thus break
resumption. If the two connections were completely independent these
problems wouldn't have happened as you wouldn't trust the earlier data
as coming from the person you now authenticated. (My understanding of
insecure resumption is that a renegotiation was necessary to seal the
deal: i'll double check the paper to see if that's correct).

>
> Second, we do have uses for renego (see above).
>
> Third, I'm skeptical of proposals to throw the baby out with the bathwater.
>
> Fourth, renego need not complicate the TLS handshake state machine if
> we see the two (or three, or...) handshakes as distinct connections
> with channel binding of inner to outer.\

And that's not complicated? I don't see how channel binding fixes the
confusion that is changing claimed identities across connections, or
reduces the impact of renegotiation on implementation complexity.

The problem Nick had was the following: you want a software component
that sits between a bidirectional stream of bytes and a socket, and
applies TLS after the handshake has completed. Because this is C, and
not Go (or CML, or etc...), you cannot write an independent event loop
without an OS level thread. (Completing the handshake involves a bit
more work)

The usual solution would be as follows: when the host application
writes to the stream, it signals there is new data to send, which the
component dutifully encrypts, and sends (since the host application
has checked that sending is possible on the fd via poll(3) or
equivalent). On read the same thing happens in reverse.

However, with renegotiation the component suddenly goes into a state
into which sending data is dependent on receiving some data. How you
deal with this cleanly is beyond me. It's not solved by any retooling
of the API: it's fundamental to any protocol exchange in which a read
can block a write.

>
> I'll admit that the fact that we did not discover the lack of
> sufficient channel binding in resumption after the renego bug does
> give me pause.  We should audit the protocol and implementations on
> this point, but we have to anyways.  Also, note that your proposal
> regarding client certs is to push the problem to the app layer and
> hope that they get channel binding right, which given our collective
> failure to do the same in TLS should give us pause.  I.e., TANSTAAFL,
> which makes me think even more that yours is a
> throw-the-baby-out-with-the-bathwater proposal.

I'm not pushing it to the app layer any more than now, nor am I
suggesting that the average application developer be ever trusted with
cryptography. The library should say "pass me a cert" (ideally not
even that) and handle the rest.

In the course of my writing this missive, another email from you
arrived. You suggested that we hand this over to the application layer
in part, by exposing channel binding inputs and outputs. This is a
terrible idea. The application developer is not supposed to know or
understand cryptography. They are supposed to write dial("443",
"secure.example.com") and have the OS take care of determining which
certs are trusted, opening a secure connection, and the fiddly details
of managing that connection, and authenticating the user over that
connection (if needed). They get it wrong too often to be trusted with
it, and shouldn't even be trusted with cert selection (as that means
they can read certs). (TCP is spelled dial_insecure, just be sure
everyone gets the message). (and by application developer I mean me
when I don't want to think about this).

What does the application do with the return value of dial? write(2),
read(2), poll(3), close(2), just like anything else.

Sincerely,
Watson Ladd

>
> Nico
> --



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