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

Implement client session storage #293

Open
jsha opened this issue Mar 21, 2023 · 0 comments
Open

Implement client session storage #293

jsha opened this issue Mar 21, 2023 · 0 comments

Comments

@jsha
Copy link
Collaborator

jsha commented Mar 21, 2023

Right now we have rustls_server_config_builder_set_persistence to store server sessions, but contrary to the comment on rustls_session_store_get_callback, we haven't actually hooked up client session storage yet.

That's handy, because rustls now has a different API for client session storage than for server session storage. So we need to implement the FFI version of that, and don't have an existing implementation we need to break.

The rough outline is: the user will give us a void *userdata and 7 function pointers, one for each of the required functions on ClientSessionStore:

kx_hint
set_kx_hint
set_tls12_session
tls12_session
remove_tls12_session
insert_tls13_ticket
take_tls13_ticket

Each of the function pointers will have a set of parameters that starts with void *userdata; this is the equivalent of &self and will be passed through on each call to these functions.

We'll then construct a Rust struct that stores these function pointers and the userdata, essentially a dispatch table. That struct will implement ClientSessionStore by passing through calls to those functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant