-
Notifications
You must be signed in to change notification settings - Fork 695
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
binding: Add s2n_connection_get_session on the Connection #4522
Conversation
/// Retrieves the size of the session ticket. | ||
pub fn session_ticket_length(&mut self) -> Result<usize, Error> { |
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.
Should this be &mut self or just &self? Is this mutating?
Same for session_ticket
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.
No, it doesn't. Reading the c side, I think it should be safe to make it &self.
I was mainly unsure initially because of tls1.3, where these tickets can change if io is in progress.
Resolved issues:
N/A
Description of changes:
The change adds a new method in the
Connection
for the rust bindings to expose the session state. This allows clients/servers to capture the most recent session outside of theSessionTicketCallback
callback.Until #4264 is addressed, this allows sessions for TLS1.2 or lower to be cached with data other than a servername.
Call-outs:
The C api requires an allocation for writing the session, In order to provide a simpler rust API, and be consistent with some of the other apis in Connection, the buffer allocation is performed within the
connection::session
method itself.Testing:
Unit tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.