Re: [TLS] SNI with early data

Benjamin Kaduk <bkaduk@akamai.com> Fri, 21 July 2017 17:46 UTC

Return-Path: <bkaduk@akamai.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 88DF6131C4E for <tls@ietfa.amsl.com>; Fri, 21 Jul 2017 10:46:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=akamai.com
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 ST3SfDuF79hY for <tls@ietfa.amsl.com>; Fri, 21 Jul 2017 10:46:51 -0700 (PDT)
Received: from mx0b-00190b01.pphosted.com (mx0b-00190b01.pphosted.com [IPv6:2620:100:9005:57f::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4C4C6129B15 for <tls@ietf.org>; Fri, 21 Jul 2017 10:46:51 -0700 (PDT)
Received: from pps.filterd (m0050102.ppops.net [127.0.0.1]) by m0050102.ppops.net-00190b01. (8.16.0.21/8.16.0.21) with SMTP id v6LHgAH3022796; Fri, 21 Jul 2017 18:46:46 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type; s=jan2016.eng; bh=Fl19w1ILms7yUSCjPNd9753xDAWcN8NRs7SFg5g1BhQ=; b=fdFW0Z9ktYJouX1o9I604TpByzorEjo49jqoUjrHp0WZChsElXTxuv1rt/h9j4tsza6H xFW8jCGbkfbjdxrTV4ypoq8u4viul0LQ40enm6fA1pP/CGatY6UApd5chmgPV8m6saP8 88tz2bnUe4c31ypPI4w3dra0rJGRx/X/osWlWcnU36UnTg983IYlx5K44H5xOiLYUpMb Ga/OFIZsBWLs+Xcj5hHNVWth9XXq9K+ebUxYe4STEDaXbAUpUKS/dkdXODAJGE98QLQN shaTEvhCDIjQIOiz+wR+8etX3cme2Pl8SFj1fwQXHefYIHYM56qtehU4seOlx9N8SAkh pg==
Received: from prod-mail-ppoint3 ([96.6.114.86]) by m0050102.ppops.net-00190b01. with ESMTP id 2btxg55g0k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 21 Jul 2017 18:46:46 +0100
Received: from pps.filterd (prod-mail-ppoint3.akamai.com [127.0.0.1]) by prod-mail-ppoint3.akamai.com (8.16.0.17/8.16.0.17) with SMTP id v6LHk15w014474; Fri, 21 Jul 2017 13:46:46 -0400
Received: from prod-mail-relay14.akamai.com ([172.27.17.39]) by prod-mail-ppoint3.akamai.com with ESMTP id 2bqecvtabc-1; Fri, 21 Jul 2017 13:46:45 -0400
Received: from [172.19.17.86] (bos-lpczi.kendall.corp.akamai.com [172.19.17.86]) by prod-mail-relay14.akamai.com (Postfix) with ESMTP id 89D0880061; Fri, 21 Jul 2017 11:46:45 -0600 (MDT)
To: Matt Caswell <frodo@baggins.org>
Cc: "tls@ietf.org" <tls@ietf.org>
References: <CAMoSCWatQZDT8qUv7EqmTH_FJ4OjrSTXVY+he6qw6MmfJ_w8vg@mail.gmail.com> <b1396d4a-2d62-d87c-3491-a965fb89cda3@akamai.com> <CAMoSCWaWs2YwmXVr+3=bjMfbrR3LNoujOvx9hDzHwUuvNbs5eA@mail.gmail.com>
From: Benjamin Kaduk <bkaduk@akamai.com>
Message-ID: <bdb671a3-73a7-021b-83b7-ed18ef21680e@akamai.com>
Date: Fri, 21 Jul 2017 12:46:45 -0500
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1
MIME-Version: 1.0
In-Reply-To: <CAMoSCWaWs2YwmXVr+3=bjMfbrR3LNoujOvx9hDzHwUuvNbs5eA@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------4FD3A4853C92AD717431439D"
Content-Language: en-US
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-21_10:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707210276
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-07-21_10:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1707210275
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/xV_j70oMutRSlE_d2xeC08ToFPI>
Subject: Re: [TLS] SNI with early data
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
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: Fri, 21 Jul 2017 17:46:53 -0000

I put some proposed tidying in
https://github.com/tlswg/tls13-spec/pull/1061 .

More inline.

On 07/21/2017 05:14 AM, Matt Caswell wrote:
> On 20/07/17 18:10, Benjamin Kaduk wrote:
>> On 07/20/2017 04:51 AM, Matt Caswell wrote:
>>> I note in draft-21 the following text:
>>>
>>>    When clients use a PSK obtained externally to send early data, then
>>>    the following additional information MUST be provisioned to both
>>>    parties:
>>>
>>>    -  The TLS version number for use with this PSK
>>>
>>>    -  The cipher suite for use with this PSK
>>>
>>>    -  The Application-Layer Protocol Negotiation (ALPN) protocol
>>>       [RFC7301], if any is to be used
>>>
>>>    -  The Server Name Indication (SNI), if any is to be used
>> These are in addition to the hash algorithm provisioned with the
>> external psk that is needed for 1-RTT operation, as mentioned somewhat
>> in passing in section 4.2.10
>>
>>> Later it says this:
>>>
>>>    In order to accept early data, the server MUST have accepted a PSK
>>>    cipher suite and selected the first key offered in the client's
>>>    "pre_shared_key" extension.  In addition, it MUST verify that the
>>>    following values are consistent with those negotiated in the
>>>    connection during which the ticket was established.
>>>
>>>    -  The TLS version number and cipher suite.
>>>
>>>    -  The selected ALPN [RFC7301] protocol, if any.
>>>
>>>
>>> The language about "during which the ticket was established" seems to
>>> suggest that the following checks do not apply to an external PSK -
>>> which I don't think is intended. Additionally there does not seem to
>> These values are a subset of those listed above.  I believe this block
>> of text only applies to NST-provisioned PSKs being used for early data,
>> as the previous text applies to external PSKs being used for early
>> data.
> Interesting because I assumed the intention was the opposite. I'm not
> sure why this restriction should only apply to NST-provisioned PSKs.

Because a similar (slightly stronger) restriction already applies to
external PSKs, but is elsewhere in the document?

>
>>  So, since the previous list is a superset, there is no problem
>> caused by this text not applying to external PSKs.
> The earlier text is about what needs to be *provisioned* to both
> parties. This text is about what MUST be verified on the server. I
> think these are two subtly different things. I see no reason to
> exclude SNI from requiring to be verified, nor do I see a reason to

SNI must be verified in order to use the ticket for 1-RTT, which is a
prerequisite for using it for 0-RTT.  That's just covered elsewhere in
the document, and the editor apparently didn't see a need to repeat the
requirement here.

> restrict it to NST PSKs only. Either you MUST do it for both types of
> PSK or you don't need to do it at all. What is the benefit of
> complicating things by providing a partial list that MUST be verified
> for one type of PSK only?

Yes, you MUST do it for both types.  It's just (prior to my pull
request) specified in different parts of the spec, due to how it evolved.

Perhaps this requires my understanding of what it means to "provision a
PSK with associated values", namely, that the given PSK is only defined
for use with those values, and (e.g.) a server that negotiates the use
of that PSK with different value(s) is in violation of the spec.  Maybe
"provisioning a PSK with associated values" can be interpreted
differently, though, but I'm still unclear on what exactly such an
alternate interpretation would be.

> If this block of text is about NST PSKs only then the implication is
> that a server MAY tolerate discrepancies in ALPN for external PSK. At
> least that is the way I read it (although I don't think that was the
> intention).

[I'd just be repeating myself if I added something here.]

>>> be a requirement on the server to check that the SNI is consistent.
>>> So, there is a mandatory requirement for an external PSK to specify
>>> the SNI, but no requirement on the server to check that it is actually
>>> correct. Is this discrepancy intentional?
>>>
>> I'm not sure I fully understand what you are saying.
>> The text says that (for external PSKs) the SNI must be provisioned to
>> both parties, which to me implies that the server must only use the
>> given PSK for early data with the specified SNI.  (That is, that the
>> server has to check.)
> It does not imply that to me. It says it has to be provisioned. That
> fact that NST PSK MUST verify, implies to me that non-NST PSKs may
> tolerate discrepancies.

So ... what does it mean to have it provisioned and then not do anything
with it?  In such an interpretation, the text about needing to provision
those values along with the PSK has no practical effect, making it "dead
code" that should not have been in the spec in the first place.  An
interpretation where that text is not "dead code" seems much more plausible.

-Ben

>> For tickets, the requirement that SNI must match the original connection
>> is mentioned in section 4.6.1 (NewSessionTicket).
> Again...why only for NST PSKs?
>
>> In short ... I don't see any problems here.  Do you still see a problem?
> Yes - given that we have different interpretations of the same text I
> still see a problem. I think it should be a lot more explicit, and
> remove the discrepancies between NST PSKs and external PSKs.
>
> There is another example of this, earlier on in section 4.2.9:
>
> "The parameters for the 0-RTT data (symmetric cipher suite, ALPN
> protocol, etc.) are the same as those which were negotiated in the
> connection which established the PSK."
>
> This implicitly seems to only apply to NST PSKs. Why not external PSKs too?
>
> Matt