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

(feat): Adds API to allow s2n-quic to check for resumption #4335

Merged
merged 7 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bindings/rust/s2n-tls/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,11 @@ impl Connection {
}?;
Ok(self)
}

/// Allows the quic library to check if session tickets are expected
pub fn are_session_tickets_enabled(&self) -> bool {
unsafe { s2n_connection_are_session_tickets_enabled(self.connection.as_ptr()) }
}
}

impl AsRef<Connection> for Connection {
Expand Down
5 changes: 5 additions & 0 deletions tls/s2n_quic_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ bool s2n_connection_is_quic_enabled(struct s2n_connection *conn)
return (conn && conn->quic_enabled) || (conn && conn->config && conn->config->quic_enabled);
}

bool s2n_connection_are_session_tickets_enabled(struct s2n_connection *conn)
{
return conn && conn->config && conn->config->use_tickets;
}

int s2n_connection_set_quic_transport_parameters(struct s2n_connection *conn,
const uint8_t *data_buffer, uint16_t data_len)
{
Expand Down
1 change: 1 addition & 0 deletions tls/s2n_quic_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
S2N_API int s2n_config_enable_quic(struct s2n_config *config);
S2N_API int s2n_connection_enable_quic(struct s2n_connection *conn);
S2N_API bool s2n_connection_is_quic_enabled(struct s2n_connection *conn);
S2N_API bool s2n_connection_are_session_tickets_enabled(struct s2n_connection *conn);

/*
* Set the data to be sent in the quic_transport_parameters extension.
Expand Down
Loading