-
Notifications
You must be signed in to change notification settings - Fork 713
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
feat: send psk_ke_modes ext in first flight #4177
Conversation
rustls expects the psk_key_exchange_modes extension to be present in the first flight of messages if the client supports session resumption, otherwise it will not return a session ticket. This commit alters s2n-tls client behavior to match rustls expectations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a unit / self-talk test? We don't want to rely on benchmarking tests to enforce correctness.
* add compliance comment to relevant RFC section * add unit test for "should send" functionality
#4210 adds the CI workflow to assert that the interop tests contained in the rust bench crate are passing. |
* move test above functional test * change test name to fit voted majority * use helper function to construct PSK * add semi-colons to unit tests scopes
* sentence case the test names * remove the newline in the duvet comment
* assert on relevant qualities
EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(no_resumption_config, false)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I like this as a solution :)
Resolved issues:
#4124
Description of changes:
More context is in the linked issue, but essentially rustls expects the
psk_key_exchange_modes
extension to be sent in the first flight of messages if the client wants a session ticket. s2n-tls does not sent this extension in the first flight of messages, so rustls servers won't send a session ticket, so s2n-tls clients can't use session resumption with rustls servers.This PR changes s2n-tls behavior to send the
psk_key_exchanges_modes
extension whenever the clients supports either stateful or stateless session resumption. We still include the final check for PSKs to support out of bands PSKs.This change should be a strict increase in compatibility with other implementations.
Testing:
We have interop testing for session resumption in the rust bindings. Additionally all of the current unit tests pass.
I'm a little concerned that there isn't any direct testing of stateful session resumption. Testing that is going to be a little tricky, and the easiest way to do so would probably be to just add it to our benchmarking harness implementation? I'm interested in reviewers thoughts about whether this is a good investment of our time.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.