Subject: [TLS] Flags extension and announcing support

From: Yoav Nir <[email-masked]>
Date: Fri, 22 Jan 2021 07:16:20 +0200

Hi.

See this PR: https://github.com/tlswg/tls-flags/pull/5 <https://github.com/tlswg/tls-flags/pull/5>

The PR is for clarifying what TLS messages may carry the flags extension.  So any message that can carry an extension, can carry a flags extension (if there are flags defined for that message). These are:
ClientHello
ServerHello
EncryptedExtensions
Certificate
CertificateRequest
HelloRetryRequest
NewSessionTicket

All except the first are Server-side.

The controversy is about unsolicited flags. An unsolicited flag is a flag that is set in a Flags extension in a server-side message without having been first declared in the ClientHello extension.

There is no controversy about flags in ServerHello and EncryptedExtensions. Those cannot have unsolicited flags, because both messages are responses to the ClientHello. 

The question is about the other messages. especially the NST and CR.

What do other think?

Yoav

---

From: "Martin Thomson" <[email-masked]>
Date: Fri, 22 Jan 2021 16:45:30 +1100

On Fri, Jan 22, 2021, at 16:16, Yoav Nir wrote:
> See this PR: https://github.com/tlswg/tls-flags/pull/5

It looks like there is lots of disagreement there.  I'm going to disagree with others too.

> All except the first are Server-side.

Certificate is client-side too.

> The controversy is about unsolicited flags. An unsolicited flag is a 
> flag that is set in a Flags extension in a server-side message without 
> having been first declared in the ClientHello extension.

So I think that you need to separate requests from responses.  Because Certificate contains response to ClientHello or CertificateRequest, my view is that CertificateRequest can contain any flag (provided that the definition of that flag permits it or you don't know whether it does) and Certificate can only contain flags that CertificateRequest did.  

This is part of what Ekr seems to have objected to, and I agree with him there.  A server should be able to use any flag in NewSessionTicket or CertificateRequest because those are the messages that initiate an exchange (NST doesn't generate any response, so it's an exchange with one flight, but that's immaterial).

To review:
ClientHello is answered by HelloRetryRequest, ServerHello, EncryptedExtensions, and (server) Certificate.
CertificateRequest is answered by (client) Certificate.
NewSessionTicket is not answered (which is totally fine).

Those three first messages above can include new flags.  They can contain the extension or not at the discretion of the entity that sends the message.  Those messages that are in response can only contain the extension if the initiating message contained the extension.  Furthermore, the extension can only contain a specific flag if the initiating message contained that flag.

In other words, each flag is treated just like an empty extension: you can initiate an exchange with it, but you can only answer with it if it was initiated with it.

This differs a little from Chris who suggests that only NewSessionTicket can include a flag that was previously not indicated.

---

From: Nick Harper <[email-masked]>
Date: Fri, 22 Jan 2021 01:54:58 -0800

On Thu, Jan 21, 2021 at 9:46 PM Martin Thomson <[email-masked]> wrote:

> In other words, each flag is treated just like an empty extension: you can
> initiate an exchange with it, but you can only answer with it if it was
> initiated with it.
>
> I agree that this is the correct guiding principle for handling flags. We
should allow unsolicited flags in the same places we allow unsolicited
extensions. Going by section 4.2 of RFC 8446, that would be ClientHello,
CertificateRequest, and NewSessionTicket.

---

From: Eric Rescorla <[email-masked]>
Date: Fri, 22 Jan 2021 06:17:28 -0800

On Fri, Jan 22, 2021 at 1:55 AM Nick Harper <[email-masked]> wrote:

>> In other words, each flag is treated just like an empty extension: you
>> can initiate an exchange with it, but you can only answer with it if it was
>> initiated with it.
>>

FWIW, this is what I was trying to say as well, though I'm prepared to
believe I didn't say it.

There is also a separate but related question of whether you can send an
unsolicited flags *extension* regardless of the contents of that extension
in these messages. I believe you should be able to for the reason Nick and
Martin indicates above.

-Ekr

---

From: "Christopher Wood" <[email-masked]>
Date: Fri, 22 Jan 2021 08:02:13 -0800

On Fri, Jan 22, 2021, at 1:54 AM, Nick Harper wrote:
> I agree that this is the correct guiding principle for handling flags. 
> We should allow unsolicited flags in the same places we allow 
> unsolicited extensions. Going by section 4.2 of RFC 8446, that would be 
> ClientHello, CertificateRequest, and NewSessionTicket. 

+1 -- and thanks, Martin, for summarizing the principle so elegantly!

Best,
Chris

---

From: Yoav Nir <[email-masked]>
Date: Mon, 25 Jan 2021 23:04:16 +0200

OK. I think we have as much consensus as we’re likely to get.

I’ve updated the patch branch and PR to reflect this.

Yoav

> On 22 Jan 2021, at 7:45, Martin Thomson <[email-masked]> wrote:
> 
> _______________________________________________
> TLS mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/tls

---

From: Sean Turner <[email-masked]>
Date: Thu, 28 Jan 2021 11:13:42 -0500

Yoav,

I think that’s right, i.e., update the patch branch and PR.

spt

> On Jan 25, 2021, at 16:04, Yoav Nir <[email-masked]> wrote:
>