Skip to content

Commit

Permalink
(feat): Adds API to allow s2n-quic to check for resumption (aws#4335)
Browse files Browse the repository at this point in the history
  • Loading branch information
maddeleine authored Dec 22, 2023
1 parent 3478c90 commit b7c9dac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
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

0 comments on commit b7c9dac

Please sign in to comment.