Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS 1.3 server: Implement and test behaviour one when receiving an "early_data" extension #6360

Closed
ronald-cron-arm opened this issue Sep 26, 2022 · 3 comments · Fixed by #8727
Assignees
Labels

Comments

@ronald-cron-arm
Copy link
Contributor

SPEC:
A server which receives an "early_data" extension MUST behave in one
of three ways:

  • Ignore the extension and return a regular 1-RTT response. The server then skips past early data by attempting to deprotect received records using the handshake traffic key, discarding records which fail deprotection (up to the configured max_early_data_size). Once a record is deprotected successfully, it is treated as the start of the client’s second flight and the server proceeds as with an ordinary 1-RTT handshake.
  • ...

The purpose of this issue is to implement and test the behavior described just above.
The "configured max_early_data_size" should be 0 but in the case of early data associated to a valid PSK (valid from the handshake point of view) established through a NewSessionTicket where it is then equal to the max_early_data_size associated to the PSK.

Testing:
An MbedTLS client sends as part of a session resumption less early data than the maximum authorized by the associated ticket to an MbedTLS server but the server does not eventually accept early data (because the PSK ciphersuite is not available on the server for example). The PSK based handshake succeeds but not the early data transfer.

Depends on: #6341

@yuhaoth
Copy link
Contributor

yuhaoth commented Nov 7, 2022

There are some cases in my mind.

An MbedTLS client sends as part of a session resumption less early data than the maximum authorized by the associated ticket to an MbedTLS server but the server does not eventually accept early data (because the PSK ciphersuite is not available on the server for example). The PSK based handshake succeeds but not the early data transfer.

I think that means ext PSK 1-RTT fall back ? If yes, it is in #6541 also.

@mpg
Copy link
Contributor

mpg commented Feb 5, 2024

I have a question that may be stupid.

An MbedTLS client sends as part of a session resumption less early data than the maximum authorized by the associated ticket to an MbedTLS server but the server does not eventually accept early data (because the PSK ciphersuite is not available on the server for example).

When is this likely to happen in practice? The server issued the ticket, so it should support the ciphersuite in it. Is this about a case where the server was restarted with a new configuration but in a way that didn't invalidate the ticket? So the ticket is acceptable as such (in particular, the server still have the keys to decrypt it) but not for 0-RTT?

I mean, I see this in the RFC:

In addition, it MUST verify that the
following values are the same as those associated with the
selected PSK:
[...]
These requirements are a superset of those needed to perform a 1-RTT
handshake using the PSK in question.

so clearly if the RFC mentions it there's a reason, but scenarios where a server will accept a given ticket/PSK for 1-RTT but not for 0-RTT seem pretty rare to me.

@ronald-cron-arm
Copy link
Contributor Author

When is this likely to happen in practice? The server issued the ticket, so it should support the ciphersuite in it. Is this about a case where the server was restarted with a new configuration but in a way that didn't invalidate the ticket? So the ticket is acceptable as such (in particular, the server still have the keys to decrypt it) but not for 0-RTT?

Yes I also think it is unlikely to happen but for 1-RTT resumption the spec does not ask for the resumption ciphersuite to be the same as the original one, only their hashes need to match. Thus the spec consider this as a possible scenario but does not allow that for early data.

@mpg mpg closed this as completed in #8727 Feb 6, 2024
@minosgalanakis minosgalanakis moved this to [3.6] TLS 1.3 early data in Past EPICs Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: [3.6] TLS 1.3 early data
3 participants