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

ktls: receive app data #4201

Merged
merged 3 commits into from
Sep 18, 2023
Merged

ktls: receive app data #4201

merged 3 commits into from
Sep 18, 2023

Conversation

lrstewart
Copy link
Contributor

Resolved issues:

resolves #4168

Description of changes:

A very simple change to enable us to receive application data with ktls. We just let s2n_ktls_read_full_record behave exactly like it does without ktls. The PR is mostly just tests.

However, while this method of handling s2n_recv + ktls is very simple and easy to understand, it introduces an extra copy / extra memory buffer because we read data into conn->in instead of the application's buffer. This reduces the benefit you get from ktls.

Call-outs:

I'm pushing this as a simple, working solution. I'll need to follow up on memory optimization for recv (including #4199 (comment)), but that's probably best done separately. An optimized version won't anywhere near as clean :( But getting the tests in place now should help: s2n_recv_test and s2n_self_talk_ktls_test really shouldn't change.

Testing:

Unit and self-talk tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Sep 15, 2023
@lrstewart lrstewart marked this pull request as ready for review September 15, 2023 16:23
tls/s2n_ktls_io.c Show resolved Hide resolved
tests/unit/s2n_ktls_io_test.c Outdated Show resolved Hide resolved
tests/unit/s2n_self_talk_ktls_test.c Outdated Show resolved Hide resolved
tests/unit/s2n_self_talk_ktls_test.c Outdated Show resolved Hide resolved
@lrstewart lrstewart requested a review from goatgoose September 15, 2023 21:16
@lrstewart lrstewart enabled auto-merge (squash) September 18, 2023 18:45
@lrstewart lrstewart merged commit 3758f4b into aws:main Sep 18, 2023
@lrstewart lrstewart deleted the ktls_recv_app_2 branch September 18, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ktls: recv app data
3 participants