Re: [TLS] RFC 5746 applicable for session resumption?

David Benjamin <davidben@chromium.org> Sun, 18 September 2022 16:15 UTC

Return-Path: <davidben@google.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 7ADF7C14F74D for <tls@ietfa.amsl.com>; Sun, 18 Sep 2022 09:15:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.827
X-Spam-Level:
X-Spam-Status: No, score=-9.827 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.571, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.org
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZEAfZJtknWTE for <tls@ietfa.amsl.com>; Sun, 18 Sep 2022 09:14:57 -0700 (PDT)
Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4FA68C14F692 for <tls@ietf.org>; Sun, 18 Sep 2022 09:14:57 -0700 (PDT)
Received: by mail-io1-xd2d.google.com with SMTP id d8so18104501iof.11 for <tls@ietf.org>; Sun, 18 Sep 2022 09:14:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=FsVsA+p0LdCS7LXoAufjFCn7VJc8ziB5EJxB4e1SBEo=; b=cgNan3Nm1ewifPl9HZ+6/h4k709eWIO0TpdTfLpbV4mElaUKvL7riOYezHMAa4W0RW LWMnd4LhNAZhV+p2r2ii0GhvJ9g6ZPzmvoZQIAw4iXkQTufrGak26Cv922qSLR5wwHkp VpduDFVqiqIUZZDRsEe3HSbSCc37vI+z2ykHM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=FsVsA+p0LdCS7LXoAufjFCn7VJc8ziB5EJxB4e1SBEo=; b=norsZa36ctiFt0tYgsDfHxOyK+Sm/cYKbsfh5DJU57kOj4hzjEx0RIotzg4GPTDku7 N8uKDSReMR6MBo+oafcJRhg6iZOSvzLOCMkW01+Xv2jrHK5xmf5iS8bROUqO20lTDJep 8UmCk+9jC2t7JLqDwHpHbH2jNSz/DtxrUPXOYcklCLMKwxQbS0ZkDRlv2MbdoCw/wh3D njyJaBiEVKeqdi6Vit8W7Gdl2VApG8cj4bZR532hdEemfyRWpZPvw7oVFGIIKLHQotAf IDesFSbGDq2uImZSpbTsfQjjq0ZvACV2PeYWRJ+FKnhPiD3Jx3g2Rjvzd7BNjSyuXK2m yvEg==
X-Gm-Message-State: ACrzQf1D2Znm69PuVoctvuUijf7zQwW2fJ9abVYUIE92YK8uaaFmO4RC bl6ecJVl3hxdnIMl7XpIfx9ZEO+OTEBBMzhJT9Y4RNB6UlaE
X-Google-Smtp-Source: AMsMyM4IPLXVYyS/FhBCzDcGVuKTtJWGzXzcyICzGVd5tRIh4vGm/yDqyofhEzyqSIBCZPkf2oQWqTWxyrRehbOt1Qw=
X-Received: by 2002:a05:6638:258c:b0:35a:7227:3e5c with SMTP id s12-20020a056638258c00b0035a72273e5cmr6330406jat.168.1663517695098; Sun, 18 Sep 2022 09:14:55 -0700 (PDT)
MIME-Version: 1.0
References: <DU0PR10MB5196BE09EEC05964D276B277F36A9@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM> <DU0PR10MB519607DB0156D73458756E9FF3499@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM> <YyMrlIAcdSob8bcF@straasha.imrryr.org> <DU0PR10MB519653F68787C8E6A93974E6F3489@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM>
In-Reply-To: <DU0PR10MB519653F68787C8E6A93974E6F3489@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM>
From: David Benjamin <davidben@chromium.org>
Date: Sun, 18 Sep 2022 09:14:39 -0700
Message-ID: <CAF8qwaBkZ2ysxga++LZ-neLvWegq6OKNKZGvMdAgpPJxvMtf9w@mail.gmail.com>
To: "Fries, Steffen" <steffen.fries@siemens.com>
Cc: "tls@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000004b7c3905e8f5e5c0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/0RM-4Wlkpccis1y0aMu2dKY_uLM>
Subject: Re: [TLS] RFC 5746 applicable for session resumption?
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.39
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: Sun, 18 Sep 2022 16:15:01 -0000

The exact contents and structure of StatePlaintext and ticket itself are up
to the implementation to decide. This format is merely a recommendation or
example. The only interop requirements are that the server maintain enough
state that it can correctly resume a session on the subsequent request.
OpenSSL, for example, uses a different serialization that includes bits of
ASN.1. Indeed the spec specifically says:

   Other TLS extensions may require the inclusion of additional data in
   the StatePlaintext structure.

So, no, you are not intended to take that structure as the literal,
complete format.

However, while other TLS extensions may require additional data, I believe
you are also misreading RFC 5746. There is no such requirement to retain
client_verify_data. client_verify_data is remembered across
*renegotiations* within
a *single connection*, not for *resumptions* across *different* connections.
Indeed RFC 5746, section 3.1 explicitly says:

   Both client and server need to store three additional values for each
   TLS connection state (see RFC 5246, Section 6.1).  Note that these
   values are specific to connection (not a TLS session cache entry).

Renegotiation and resumption are not the same thing. Renegotiation is when
you perform multiple handshakes *within a single connection*. Resumption is
when, for an individual handshake, you carry over key material and other
state from a previous connection as an optimization. It is possible for a
renegotiation handshake to be a full or resumption handshake, but RFC 5746
applies independently of this. Sections 3.4 and 3.6 say:

   Note that this section [3.4] and Section 3.5 apply to both full
handshakes
   and session resumption handshakes.

   Note that this section [3.6] and Section 3.7 apply to both full
handshakes
   and session-resumption handshakes.

This applies to both session-ID-based resumption and session-ticket-based
resumption. However, this does *not* mean you retain client_verify_data and
server_verify_data in the session state. You maintain it in the *connection*.
Whatever the previous handshake at the connection was, you use its Finished
messages as the next handshake's renegotiation_info values. (All applicable
handshakes, full or resumption, ticket or ID, have Finished messages.)
Maintaining it in the session state wouldn't be useful because a session
may span connections, and that's not the binding that RFC 5746 is intended
to apply. That is, suppose connection C1 handshakes and established session
S1, sending Finished messages F1. If connection C2 handshakes and happens
to resume session S1, you *do not* use F1 as the renegotiation_info C2. It
is even possible that, within a single connection, handshake 3 resumes a
session established by handshake 1. Even so, you use handshake 2's Finished
messages in handshake 3, not handshake 1.


On Fri, Sep 16, 2022 at 7:15 AM Fries, Steffen <steffen.fries@siemens.com>
wrote:

> Hi Viktor,
>
> Thank you for the info. Regarding the information in the ticket, I was
> looking at the recommended ticket structure in RFC 5077 section 4 (
> https://datatracker.ietf.org/doc/html/rfc5077#section-4). There is the
> encrypted_state mentioned, which contains the encrypted information stated
> in the structures in section 4. For the renegotiation extension
> verification from RFC 5746 section 3.7 (
> https://datatracker.ietf.org/doc/html/rfc5746#section-3.7), the server
> must have the client_verify_data, which is not part of the ticket in the
> StatePlaintext structure. That was the reason for assuming that the
> renegotiation extension may not be used in the case of ticket based
> resumption. If the server puts this information (from the Finish message)
> into the ticket, it could reconstruct it. Maybe I was taking the section 4
> of RFC 5077  to literally.
>
> Best regards
> Steffen
>
> > -----Original Message-----
> > From: TLS <tls-bounces@ietf.org> On Behalf Of Viktor Dukhovni
> > Sent: Donnerstag, 15. September 2022 15:42
> > To: tls@ietf.org
> > Subject: Re: [TLS] RFC 5746 applicable for session resumption?
> >
> > On Thu, Sep 15, 2022 at 01:16:33PM +0000, Fries, Steffen wrote:
> >
> > > I was just double checking if there was an answer to the question of
> > > using the TLS renegotiation extension from RFC 5746 in the context of
> > > TLS session resumption. As stated below, based on the RFC it is not
> > > crystal clear if it applies. In general I would think yes, but only
> > > for session resumption based on the sessionID, not based on tickets.
> >
> > There should be no difference between (server-side) stateful and
> stateless
> > resumption.  The server should serialise into the session ticket
> sufficient
> > information to allow it to fully recover the session, as though it were
> cached
> > locally to facilitate stateful resumption.
> >
> > This is the case at least with OpenSSL, the session ticket contains and
> encrypted
> > and MACed serialised SSL_SESSION object, in exactly the same form as it
> would
> > have in a server-side session cache.
> >
> > --
> >     Viktor.
> >
> > _______________________________________________
> > TLS mailing list
> > TLS@ietf.org
> >
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.ietf
> > .org%2Fmailman%2Flistinfo%2Ftls&amp;data=05%7C01%7Csteffen.fries%40sie
> > mens.com%7Cb07ba1db3dfc413ab86208da9720128d%7C38ae3bcd95794fd4ad
> > dab42e1495d55a%7C1%7C0%7C637988461247843608%7CUnknown%7CTWFpb
> > GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6M
> > n0%3D%7C3000%7C%7C%7C&amp;sdata=XWMXniQ6lhqUtpn89V1Nb0ap1VEsH
> > lOpeCkxsDBSgKU%3D&amp;reserved=0
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>