Re: [TLS] HTTP, Certificates, and TLS

Ilari Liusvaara <ilariliusvaara@welho.com> Thu, 21 July 2016 18:00 UTC

Return-Path: <ilariliusvaara@welho.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 2B64C12D768 for <tls@ietfa.amsl.com>; Thu, 21 Jul 2016 11:00:06 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.187
X-Spam-Level:
X-Spam-Status: No, score=-3.187 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-1.287] 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 TAu-7nlyqvEk for <tls@ietfa.amsl.com>; Thu, 21 Jul 2016 11:00:03 -0700 (PDT)
Received: from welho-filter2.welho.com (welho-filter2.welho.com [83.102.41.24]) by ietfa.amsl.com (Postfix) with ESMTP id 6FE3E12D0B5 for <tls@ietf.org>; Thu, 21 Jul 2016 11:00:03 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by welho-filter2.welho.com (Postfix) with ESMTP id 14F7284BE; Thu, 21 Jul 2016 21:00:02 +0300 (EEST)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp3.welho.com ([IPv6:::ffff:83.102.41.86]) by localhost (welho-filter2.welho.com [::ffff:83.102.41.24]) (amavisd-new, port 10024) with ESMTP id CqZgM4mIAvIa; Thu, 21 Jul 2016 21:00:01 +0300 (EEST)
Received: from LK-Perkele-V2 (87-100-177-32.bb.dnainternet.fi [87.100.177.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by welho-smtp3.welho.com (Postfix) with ESMTPSA id 484DF2315; Thu, 21 Jul 2016 21:00:01 +0300 (EEST)
Date: Thu, 21 Jul 2016 20:59:56 +0300
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: Martin Rex <mrex@sap.com>
Message-ID: <20160721175956.GA24593@LK-Perkele-V2.elisa-laajakaista.fi>
References: <CABkgnnV-FuEt9bUc1s7vUSkpv3jQrBxK7S-8RzM7B=5EiFg8MA@mail.gmail.com> <20160721170804.F38B01A504@ld9781.wdf.sap.corp>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <20160721170804.F38B01A504@ld9781.wdf.sap.corp>
User-Agent: Mutt/1.6.0 (2016-04-01)
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/06VT2KuF3T7aYXRBJrEqTc3YMQE>
Cc: Mike Bishop <Michael.Bishop@microsoft.com>, "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] HTTP, Certificates, and TLS
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: Thu, 21 Jul 2016 18:00:06 -0000

On Thu, Jul 21, 2016 at 07:08:04PM +0200, Martin Rex wrote:
> Martin Thomson wrote:
> > On 21 July 2016 at 18:41, Martin Rex <mrex@sap.com> wrote:
> >>    A server that implements this extension MUST NOT accept the request
> >>    to resume the session if the server_name extension contains a
> >>    different name.  Instead, it proceeds with a full handshake to
> >>    establish a new session.
> > 
> > If that's the only barrier to doing this, I'd be surprised.  The
> > prospect of having to overcome this is not at all daunting.
> 
> No, that is only the tip of an iceberg, and you're going Titanic here.
> 
> Really, this is about TLS session cache management (which is something
> very close to TLS) vs. Endpoint identification, i.e. interpreting
> end-entity certificates -- which is something that is explicitly
> outside of the scope of TLS (e.g. rfc2818 and rfc6125).
> 
> 
> Could you please describe the approach to session cache management that
> you're conceiving here? 

Well, I guess it would be reasonable to remember the server identites
on client side, but clear client identities on server side.

Especially the client identies are highly important: If the server
thinks any identity is valid that client thinks is invalid, that will
lead to attacks.

> In the original TLS architecture (up to TLSv1.2)
> TLS sessions are read-only after creation, and identities (certificates)
> are locked down.  Forgetting to cryptographically bind the communication
> identities into the session properties allowed the triple-handshake-attack.

No, THS was caused by failing to bind the exchange keys (I consider the
abstract of EMS RFC to be quite misleading).

> If you want to change any session properties (including certificates),
> you MUST perform a new full handshake, which creates a new session with
> new properties and a new session ID / session cache entry.

And thanks to all sorts of crypto restrictions, exchange keys have
nothing to do with certificates of any kind (all modes where they
have anything to do are banned), and that the exchange keys are properly
bound.

> Session resumption (and session resumption proposal) should operate
> based on requested properties (is there an existing session with the
> requested properties?) and this is conceptually independent from the
> app-level endpoint identification (such as rfc2818/rfc6125).
> 
> The wording in rfc6066 is not optimal.  It should have better said:
> whenever a full handshake would result in selection of a different
> server certificate, then the server MUST perform a full handshake,
> in order to produce predictable/deterministic behaviour that is
> not side-effected by session cache management / session cache lifetime
> effects.  The principle of least surprise.

Within context of HTTP, the server authentication is about what
authorities the server is allowed to assert. And in responses, the
server always needs to pick the authority it asserts.

As long as one takes care that no authorities get lost, or that lost
authorities can be recovered if needed (and authroized), then the
behaviour will remain deterministic (modulo possibly few extra RTTs
to recover the lost authroties).


Now, client authentication is entierely different beast. The client
won't inherently assert its authority in HTTP, so the server view
of client authority damn better be subset of what client intended,
or you WILL get privilege escalation attacks.

>From that it follows that the client needs per-request control of
authorities it holds (if to assert them or to disclaim them).



-Ilari