Implement client session storage
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 170
- Forks
- 43
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading rustls_session_store_get_callback and rustls_server_config_builder_set_persistence, then compare the linked rustls ClientSessionStore API. Define the FFI surface for the seven callbacks and userdata, implement the dispatching ClientSessionStore, and verify that each callback is forwarded with userdata; done means client session storage is exposed through the FFI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100