Re: [TLS] Application data during renegotiation handshake

David Benjamin <davidben@chromium.org> Mon, 16 November 2015 17:08 UTC

Return-Path: <davidben@google.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 ECA521A6FE2 for <tls@ietfa.amsl.com>; Mon, 16 Nov 2015 09:08:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 1.237
X-Spam-Level: *
X-Spam-Status: No, score=1.237 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, GB_ABOUTYOU=0.5, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.585, 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 WC__vLRVYfNz for <tls@ietfa.amsl.com>; Mon, 16 Nov 2015 09:08:56 -0800 (PST)
Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 34F041A6F86 for <tls@ietf.org>; Mon, 16 Nov 2015 09:08:56 -0800 (PST)
Received: by igl9 with SMTP id 9so61490497igl.0 for <tls@ietf.org>; Mon, 16 Nov 2015 09:08:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=0W2Hijhi29rVKbpcPC4IdWaB/31tnAQ9kWUQFyI0fFM=; b=ZD3rQ04633V+zT/+3jtR3QkDUT4W71phKdi2YjwKHJXv7QAXRhD4xcYC/aDn7ZZ2aY NRZxEW/C8RTdoImhIuslvqDfB3Pe/t7ugjOoDLWu2bUaa09sM7qqNOI6x1Kf6SwLwHLP iavbZvu9FY6XolW3s/z8l2MzIhUZ0Z/by2DF4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-type; bh=0W2Hijhi29rVKbpcPC4IdWaB/31tnAQ9kWUQFyI0fFM=; b=iYkZarRvoE9bquo67Ke7QL7sdgE0tg/pOgyg9jKGDmFSudJdxJo5+rTy3KjxeE7sYH Cj/TaD3qp+nfZlqfaK7uvXyAOxfxPtPZ4/hPG5y+WulochfDbjQBf/OlgPlmY64pPoR7 BtZBV9kb0WhQgKzpVepbIWgMdjICAYAp2+ebMbFUeCVXFFMBF5T8Wl47hbzEPAx6uCA9 0sMZRysbRfSA6w0UynVLfhtOOKKzUz7lEcXnGd4fu2S5GfX/5cu+Vl6s7R56WfQ3Ux9N 51jQ/pfoMUV8Y3av8XVfQrhGvo5ku+GuN3jlfhhETFSGspSomrT0x1oSiu4VUVX+Tf40 bWfg==
X-Gm-Message-State: ALoCoQl8VZog+ATlxCr/aCy/DQbHw+KiL9tYuBXIY5Bb/4fch6n9TaAlS9p1nVpyAxe1eycZAPf1
X-Received: by 10.50.138.3 with SMTP id qm3mr4488128igb.11.1447693735430; Mon, 16 Nov 2015 09:08:55 -0800 (PST)
MIME-Version: 1.0
References: <CY1PR03MB13743E3AE466C2F8F7AC140687130@CY1PR03MB1374.namprd03.prod.outlook.com> <CAMfhd9UV=Zya6dort29J0s7NcrbrU=a-6+diD_Sq9U6h2x1fgQ@mail.gmail.com> <F36034F5-2B2C-4E36-B44D-E581AD0B813E@gmail.com> <CAF8qwaBYpDxynY6QpPC++AH7JR46R3NH2WmWfUS60TCWodp+cA@mail.gmail.com> <BN3PR03MB1367EAFDEE6FA4D3433C50CF87120@BN3PR03MB1367.namprd03.prod.outlook.com>
In-Reply-To: <BN3PR03MB1367EAFDEE6FA4D3433C50CF87120@BN3PR03MB1367.namprd03.prod.outlook.com>
From: David Benjamin <davidben@chromium.org>
Date: Mon, 16 Nov 2015 17:08:45 +0000
Message-ID: <CAF8qwaC2oRU8L2t91e8EWjouqyf10SkwGWb2GBQQbBAkDQcLcA@mail.gmail.com>
To: Mike Bishop <Michael.Bishop@microsoft.com>, Yoav Nir <ynir.ietf@gmail.com>, Adam Langley <agl@imperialviolet.org>
Content-Type: multipart/alternative; boundary="001a1134cb0cd890820524ab7693"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/h4rGpqZzxBsrO3SmenFIvdGWpdI>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Application data during renegotiation handshake
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: <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: Mon, 16 Nov 2015 17:09:00 -0000

[Reordering your message slightly so the important question is first.]

[MB] When I say “application,” I mean the code being hosted by the web
server that’s actually responding to the interpreted requests.  While I’d
like to minimize code changes in the HTTP server, my primary constraint is
that I don’t change the application they’re hosting at all.  The change to
HTTP/2 and/or TLS 1.3 should be as transparent as possible.  Keeping auth
that’s currently done via TLS still in TLS helps to reduce those changes at
higher layers.

[DB] Right, this is why, again, I'm asking for what interface,
specifically, are you trying to hold fixed? I can imagine a number of
interfaces, ranging from the OpenSSL/Apache boundary (basically impossible,
but not your definition of "application") to the Apache/.htaccess boundary
(compat is trivial, but probably simpler than your "application"). Without
knowing what interface constrains you, it's very difficult to explore the
problem space.

On Thu, Nov 12, 2015 at 4:09 PM Mike Bishop <Michael.Bishop@microsoft.com>
wrote:

> Doing it at the HTTP layer (as an authentication mechanism) is
> challenging, since applications aren’t expecting to receive it that way,
> and moves the authenticated exchange onto a different stream than triggered
> it.
>
Note I provided two (sketches of) proposals, only one of which switches
streams. What's incompatible with adapting the SPDY CREDENTIAL frame but
tweaking it so it is asserted mid-stream? I would prefer two separate
requests, but it seems we could avoid touching the socket layer either way.

> I know that there’s the possibility for a layer to fake the client going
> away while actually sending a 401, but then you have to be able to tie the
> client’s second attempt back to the challenge, don’t you?
>
I don't believe so. But, again, you haven't given me the actual interface,
so I have to speculate. Can't you can defer checking against the challenge
to when you receive it? So, something like:

First request:
1. Client hits frontend.
2. [frontend <-> application] Frontend forwards HTTP request to appropriate
application.
3. [frontend <-> application] Application requests certificate auth,
handing frontend information to go in CertificateRequest, along with
information on how to verify the certificate.
4. Frontend surfaces CertificateRequest information with the HTTP 401
response or similar. Request ends, frontend saves no state.
5. [frontend <-> application] Application thinks the client ran away.

Second request (maybe doesn't happen, maybe happens without the first
request, doesn't matter):
1. Client hits frontend. It authenticates the request with certificate
chain C. (I dunno, sign an exporter value or whatever. Or maybe you do the
CREDENTIAL frame + slotted SYN_STREAM route to save on signatures. Or maybe
there's something more complex with nonces. We can sort out the exact
details.)
2. Frontend checks the client is authenticated as C, but doesn't do
anything with C as it doesn't remember the application's challenge. Whether
C is a meaningful identity is not its problem yet.
3. [frontend <-> application] Frontend forwards HTTP request to appropriate
application.
4. [frontend <-> application] Application requests certificate auth,
handing frontend information to go in CertificateRequest, along with
information on how to verify the certificate. This is the same output as in
step 3 of the first request.
5. Frontend verifies C against information the application gave, etc.
Whatever it would have done before.
6. [frontend <-> application] Frontend reports that the client, remarkably
quickly :-), received the challenge and authenticated as C. Application
continues as it did with the renego hack.


> In the HttpBis working group meeting, there was fairly strong consensus
> that we needed a backward-compatibility mechanism for existing apps moving
> to HTTP/2 over TLS 1.[23]; there was also interest in defining something
> cleaner in the future for new apps that could adopt something brand new,
> but not at the expense of quickly enabling current apps to keep working.
> The draft below is the current candidate for least-ugly compat solution.
> Doing it at the framing layer is definitely a good option for the something
> cleaner.
>

It's possible that I'm misunderstanding the requirements, but if it is
possible for the "something cleaner" and "ugly compat solution" to be the
same, that is certainly preferable, no? It's possible my guesses about your
constraints are incorrect, but so far I'm not seeing any reason that
wouldn't be possible. What am I missing here?

David


>
>
> *From:* David Benjamin [mailto:davidben@chromium.org]
> *Sent:* Thursday, November 12, 2015 12:43 PM
> *To:* Yoav Nir <ynir.ietf@gmail.com>; Adam Langley <agl@imperialviolet.org
> >
> *Cc:* Mike Bishop <Michael.Bishop@microsoft.com>; tls@ietf.org
> *Subject:* Re: [TLS] Application data during renegotiation handshake
>
>
>
> On Wed, Nov 11, 2015 at 10:43 PM Yoav Nir <ynir.ietf@gmail.com> wrote:
>
>
> > On 12 Nov 2015, at 3:32 AM, Adam Langley <agl@imperialviolet.org> wrote:
> >
> > The TLS 1.3 post-handshake client-auth was intended, as I recall, to
> > support HTTP/1.1 over TLS 1.3.
>
> No, it was (and is) presented as a way to do client certificate
> authentication with HTTP/2 not at the initial handshake.
>
> > With HTTP/2 isn't it cleaner to do client-auth at the HTTP layer (i.e.
> > by signing exporter values)?
>
> It is. I thought that an HTTP authentication method based on certificates
> could be a drop-in replacement for TLS layer authentication, but someone (I
> think it was Mike) pointed out that with TLS-layer certificate
> authentication the stream continues after the authentication, while with
> HTTP-layer authentication, the stream ends with a 401 status code, and the
> client has to start a new stream with the Authorization header. So
> applications would need to be changed for this to work.
>
>
>
> Using existing HTTP semantics would certainly be cleaner in a vacuum, but
> one could still do it in HTTP/2 layer without creating a new stream.
> Perhaps adapt SPDY's CREDENTIAL frame and add a new SWITCH_CREDENTIAL frame
> to swap a stream's credential slot mid-stream?
>
>
>
> Alternatively, HTTP/2 frontend could make the application think there were
> two independent requests. Am I misunderstanding the objection? What about
> this:
>
> 1. Client hits HTTP/2 frontend. Frontend talks to application which
> decides it needs client auth, expecting it on the same stream.
>
> 2. Frontend immediately aborts that request and returns a 401 to the
> client. Application thinks the client just gave up.
>
> 3. Client makes a new stream, now authenticated. The frontend hits the
> application fresh. Application requests client auth as before and frontend
> responds immediately with the certificate the client asserted.
>
> This is, by the way, how Chrome implements client auth today, even with
> renego. We never reconfigure client auth mid-stream.
>
>
>
> I think it would be helpful to have examples of exactly what the
> applications look like, to know what constraints the various interested
> parties are working with.
>
>
>
> For example, Apache httpd has some high-level configuration file.
>
> https://httpd.apache.org/docs/2.2/ssl/ssl_howto.html#arbitraryclients
>
> Existing Apache installs can easily compatibility regardless of how the
> HTTP/TLS interaction looks.
>
>
>
> On the other extreme, if the goal is to keep Apache httpd unchanged while
> only changing OpenSSL, then we have a very different picture because the
> OpenSSL API is SSL_renegotiate/SSL_do_handshake (send a HelloRequest) +
> SSL_set_state/SSL_do_handshake (don't continue until renego completes).
> That one is quite overfit to the old flow and will be difficult to
> reconcile with almost anything.
>
>
>
> draft-thomson-http2-client-certs-00's HTTP/2 mode seems to be targeting
> something in between. It's okay with adding a new application_context_id,
> but the client certificate still needs to be asserted at the transport. I'm
> having a hard time divining the constraints from this.
>
>
>
> David
>