Re: [TLS] draft-ietf-tls-ticketrequests-05

2020-07-03 Thread Hannes Tschofenig
Hi Ilari,

Please see my comments below.

-Original Message-
From: ilariliusva...@welho.com 
Sent: Wednesday, July 1, 2020 8:49 PM
To: Hannes Tschofenig 
Cc:  
Subject: Re: [TLS] draft-ietf-tls-ticketrequests-05

On Wed, Jul 01, 2020 at 04:52:18PM +, Hannes Tschofenig wrote:
> Hi Tommy, Hi David, Hi Chris,
>
> I read through the draft and have a few questions.
>
> 1) Is it really necessary for the client to use two values to
> differentiate the tickets it wants with a new session and with
> resumption. It feels a bit over-designed. I would just have one value
> and that alone would be super useful already.

Consider a client that does:

- Parallel connections
- Does not reuse tickets

Such client needs enough tickets to cover the multiple connections in case of 
fresh handshake (might be 5-10 or so), but only needs to replace the tickets 
for current connection (1 or 2) in case of resumption. So any single value will 
result in oversupply or undersupply.

[Hannes] The client is probably in the best position to know how many tickets 
it wants. I don't see the case where it is necessary to distinguish two types 
of tickets with this extension. I want this to be as simple as possible.

> 2) This sentence confuses me:
> "
>Servers SHOULD NOT send more tickets than requested for the handshake
>type selected by the server (resumption or full handshake).
>Moreover, servers SHOULD place a limit on the number of tickets they
>are willing to send, whether for full handshakes or resumptions, to
>save resources.
> "
>
> Shouldn't the sentence say:
> "
>Servers SHOULD NOT send more tickets than requested for the handshake
>type (resumption or full handshake) indicated by the client.
> "

The server might not want to actually honor request to send 255 tickets.
Even if ticket minting is a fast operation, 255 of them might take non- trivial 
time (and bandwidth).

[Hannes] I was trying to point out that there appears to be a bug in the 
sentence.
(at least that's my understanding as a non-English native speaker)

> Even then, I believe the sentence should actually say MUST NOT instead
> of SHOULD NOT. If the client is already taking the effort to indicate
> that it does not want more than a certain number of tickets then it
> might have a reason. I am thinking about the case where the client
> indicates that it does not want any tickets then it would be strange
> for the server expressing support for the extension and still send
> tickets.

If the client signals 0 tickets for handshake and 0 tickets for resumption, 
then reasonable interpretation is that client does not support resumption at 
all, and it is waste of resources to send it any tickets.

[Hannes] Correct. This is what I am saying. Currently the text allows the 
server to still send a ticket even though the client says "don't send it".

But how should server interpret client saying it wants 1 ticket for full 
handshake and 0 tickets for resumption? A reasonable interpretation is that 
client does support tickets and is is willing to reuse tickets.
So if the server is not willing to reuse tickets, the most reasonable action is 
to send 1 ticket to the client on resumption (if server is willing to reuse 
tickets, the most reasonable act is not send any tickets on resumption).

[Hannes] If the client says it only wants one ticket then he should only get 
one ticket. If it wants another ticket when it resumes the session then the 
client can ask for another ticket.

Basically, there can be good reasons to send more tickets than requested. Just 
that most of the time, sending more tickets will lead to oversupply.

[Hannes] It would be good to decide who makes the decisions in this process. If 
we want to give the client the possibility to indicate how much it wants to 
receive and you can still give the server the ability to send less. Currently, 
the authors did not decide what they want.

> 4) I believe it would make sense to define a ticket flag for the case
> where the client does not want to receive any tickets.

The sensible way to indicate that is to send (0,0) as requested ticket count.

[Hannes] I am suggesting to use the newly defined flags extension draft (see 
https://tools.ietf.org/html/draft-ietf-tls-tlsflags-02) for this purpose.


> 5) If a client sends the ClientTicketRequest extension during the full
> handshake is there an expectation that it sends it again in the
> resumption exchange? Would you assume that the server memorizes how
> many tickets the client wanted across the resumption handshakes?
> For example, in the full handshake I use the extension and indicate
> that I want 5 tickets. I get two tickets from the server. Then, I run
> a resumption handshake without transmitting the extension. Is the
> server expected to remember to still send

Re: [TLS] draft-ietf-tls-ticketrequests-05

2020-07-01 Thread Ilari Liusvaara
On Wed, Jul 01, 2020 at 04:52:18PM +, Hannes Tschofenig wrote:
> Hi Tommy, Hi David, Hi Chris,
> 
> I read through the draft and have a few questions.
> 
> 1) Is it really necessary for the client to use two values to
> differentiate the tickets it wants with a new session and with
> resumption. It feels a bit over-designed. I would just have one
> value and that alone would be super useful already.

Consider a client that does:

- Parallel connections
- Does not reuse tickets

Such client needs enough tickets to cover the multiple connections
in case of fresh handshake (might be 5-10 or so), but only needs to
replace the tickets for current connection (1 or 2) in case of
resumption. So any single value will result in oversupply or
undersupply.

> 2) This sentence confuses me:
> "
>Servers SHOULD NOT send more tickets than requested for the handshake
>type selected by the server (resumption or full handshake).
>Moreover, servers SHOULD place a limit on the number of tickets they
>are willing to send, whether for full handshakes or resumptions, to
>save resources.
> "
> 
> Shouldn't the sentence say:
> "
>Servers SHOULD NOT send more tickets than requested for the handshake
>type (resumption or full handshake) indicated by the client.
> "

The server might not want to actually honor request to send 255 tickets.
Even if ticket minting is a fast operation, 255 of them might take non-
trivial time (and bandwidth).

> Even then, I believe the sentence should actually say MUST NOT instead
> of SHOULD NOT. If the client is already taking the effort to indicate
> that it does not want more than a certain number of tickets then it
> might have a reason. I am thinking about the case where the client
> indicates that it does not want any tickets then it would be strange
> for the server expressing support for the extension and still send
> tickets.

If the client signals 0 tickets for handshake and 0 tickets for
resumption, then reasonable interpretation is that client does not
support resumption at all, and it is waste of resources to send it
any tickets.

But how should server interpret client saying it wants 1 ticket for
full handshake and 0 tickets for resumption? A reasonable interpretation
is that client does support tickets and is is willing to reuse tickets.
So if the server is not willing to reuse tickets, the most reasonable
action is to send 1 ticket to the client on resumption (if server is
willing to reuse tickets, the most reasonable act is not send any
tickets on resumption).

Basically, there can be good reasons to send more tickets than
requested. Just that most of the time, sending more tickets will lead
to oversupply.

> 4) I believe it would make sense to define a ticket flag for the
> case where the client does not want to receive any tickets.

The sensible way to indicate that is to send (0,0) as requested
ticket count.

> 5) If a client sends the ClientTicketRequest extension during the
> full handshake is there an expectation that it sends it again in
> the resumption exchange? Would you assume that the server memorizes
> how many tickets the client wanted across the resumption handshakes?
> For example, in the full handshake I use the extension and indicate
> that I want 5 tickets. I get two tickets from the server. Then, I
> run a resumption handshake without transmitting the extension. Is
> the server expected to remember to still send 3 more tickets till
> the quota is exhausted?

I expect each connection to have its own ticket request counts.

In general, it is unsafe to cache extension values across connections
in session. Sure, one probably can not cause anything bad with this
extension, but with things like server_name, very bad stuff can happen
if those are not taken from connection handshake.


> 6) The topic of when to send the tickets is something you mention
> in the document and it is indeed an issue. Have you thought about
> allowing the client to signal to the server when to send the
> tickets? Even making a distinction between "send me all tickets in
> a batch" and "send one after the other with some reasonable time in
> between" would be helpful.

What usecases would there be in spreading tickets in time?


-Ilari

___
TLS mailing list
TLS@ietf.org
https://www.ietf.org/mailman/listinfo/tls


[TLS] draft-ietf-tls-ticketrequests-05

2020-07-01 Thread Hannes Tschofenig
Hi Tommy, Hi David, Hi Chris,

I read through the draft and have a few questions.

1) Is it really necessary for the client to use two values to differentiate the 
tickets it wants with a new session and with resumption. It feels a bit 
over-designed. I would just have one value and that alone would be super useful 
already.

2) This sentence confuses me:
"
   Servers SHOULD NOT send more tickets than requested for the handshake
   type selected by the server (resumption or full handshake).
   Moreover, servers SHOULD place a limit on the number of tickets they
   are willing to send, whether for full handshakes or resumptions, to
   save resources.
"

Shouldn't the sentence say:
"
   Servers SHOULD NOT send more tickets than requested for the handshake
   type (resumption or full handshake) indicated by the client.
"

Even then, I believe the sentence should actually say MUST NOT instead of 
SHOULD NOT. If the client is already taking the effort to indicate that it does 
not want more than a certain number of tickets then it might have a reason. I 
am thinking about the case where the client indicates that it does not want any 
tickets then it would be strange for the server expressing support for the 
extension and still send tickets.

3) Does the server really need to send the number of tickets it is planning to 
send back to the client? In the draft you already indicate that the server may 
send fewer tickets than requested by the client. So, the number expressed by 
the client is an upper limit anyway.

4) I believe it would make sense to define a ticket flag for the case where the 
client does not want to receive any tickets.

5) If a client sends the ClientTicketRequest extension during the full 
handshake is there an expectation that it sends it again in the resumption 
exchange? Would you assume that the server memorizes how many tickets the 
client wanted across the resumption handshakes? For example, in the full 
handshake I use the extension and indicate that I want 5 tickets. I get two 
tickets from the server. Then, I run a resumption handshake without 
transmitting the extension. Is the server expected to remember to still send 3 
more tickets till the quota is exhausted?

6) The topic of when to send the tickets is something you mention in the 
document and it is indeed an issue. Have you thought about allowing the client 
to signal to the server when to send the tickets? Even making a distinction 
between "send me all tickets in a batch" and "send one after the other with 
some reasonable time in between" would be helpful.

Ciao
Hannes

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

___
TLS mailing list
TLS@ietf.org
https://www.ietf.org/mailman/listinfo/tls