Skip to content

Commit

Permalink
Provide stubs for SSL_{CTX_,}_{get,set}_ex_data
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Feb 23, 2024
1 parent 680f023 commit 59e4ab5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rustls-libssl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_CTX_ctrl",
"SSL_CTX_free",
"SSL_CTX_get_cert_store",
"SSL_CTX_get_ex_data",
"SSL_CTX_get_options",
"SSL_CTX_load_verify_dir",
"SSL_CTX_load_verify_file",
"SSL_CTX_new",
"SSL_CTX_set_alpn_protos",
"SSL_CTX_set_ex_data",
"SSL_CTX_set_options",
"SSL_CTX_set_verify",
"SSL_CTX_up_ref",
Expand All @@ -75,6 +77,7 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_get1_peer_certificate",
"SSL_get_current_cipher",
"SSL_get_error",
"SSL_get_ex_data",
"SSL_get_options",
"SSL_get_peer_cert_chain",
"SSL_get_shutdown",
Expand All @@ -92,6 +95,7 @@ const ENTRYPOINTS: &[&str] = &[
"SSL_set_alpn_protos",
"SSL_set_bio",
"SSL_set_connect_state",
"SSL_set_ex_data",
"SSL_set_fd",
"SSL_set_options",
"SSL_set_shutdown",
Expand Down
28 changes: 28 additions & 0 deletions rustls-libssl/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ entry! {
}
}

entry! {
pub fn _SSL_CTX_set_ex_data(_ssl: *mut SSL_CTX, _idx: c_int, _data: *mut c_void) -> c_int {
// TODO: this always fails; it could be implemented faithfully
0
}
}

entry! {
pub fn _SSL_CTX_get_ex_data(_ssl: *const SSL_CTX, _idx: c_int) -> *mut c_void {
// TODO: this always fails; it could be implemented faithfully
ptr::null_mut()
}
}

entry! {
pub fn _SSL_CTX_get_options(ctx: *const SSL_CTX) -> u64 {
let ctx = try_clone_arc!(ctx);
Expand Down Expand Up @@ -352,6 +366,20 @@ entry! {
}
}

entry! {
pub fn _SSL_set_ex_data(_ssl: *mut SSL, _idx: c_int, _data: *mut c_void) -> c_int {
// TODO: this always fails; it could be implemented faithfully
0
}
}

entry! {
pub fn _SSL_get_ex_data(_ssl: *const SSL, _idx: c_int) -> *mut c_void {
// TODO: this always fails; it could be implemented faithfully
ptr::null_mut()
}
}

entry! {
pub fn _SSL_get_options(ssl: *const SSL) -> u64 {
let ssl = try_clone_arc!(ssl);
Expand Down

0 comments on commit 59e4ab5

Please sign in to comment.