Skip to content

Commit

Permalink
Implement SSL_set_max_early_data
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Aug 29, 2024
1 parent 0fe9079 commit a9f90cc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rustls-libssl/MATRIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
| `SSL_set_generate_session_id` | | | |
| `SSL_set_hostflags` | | | |
| `SSL_set_info_callback` | | | |
| `SSL_set_max_early_data` | | :white_check_mark: | |
| `SSL_set_max_early_data` | | :white_check_mark: | :white_check_mark: |
| `SSL_set_msg_callback` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_set_not_resumable_session_callback` | | | |
| `SSL_set_num_tickets` | | | :white_check_mark: |
Expand Down
1 change: 1 addition & 0 deletions rustls-libssl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_set_connect_state",
"SSL_set_ex_data",
"SSL_set_fd",
"SSL_set_max_early_data",
"SSL_set_msg_callback",
"SSL_set_num_tickets",
"SSL_set_options",
Expand Down
9 changes: 9 additions & 0 deletions rustls-libssl/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,15 @@ entry! {
}
}

entry! {
pub fn _SSL_set_max_early_data(ssl: *mut SSL, max_early_data: u32) -> c_int {
try_clone_arc!(ssl)
.get_mut()
.set_max_early_data(max_early_data);
C_INT_SUCCESS
}
}

entry! {
pub fn _SSL_set_alpn_protos(
ssl: *mut SSL,
Expand Down
4 changes: 4 additions & 0 deletions rustls-libssl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,10 @@ impl Ssl {
self.num_tickets = num
}

fn set_max_early_data(&mut self, max: u32) {
self.max_early_data = max;
}

fn clear_options(&mut self, clear: u64) -> u64 {
self.raw_options &= !clear;
self.raw_options
Expand Down

0 comments on commit a9f90cc

Please sign in to comment.