Skip to content

Commit

Permalink
Allow SSL_{CTX_,}set_session_id_context to succeed
Browse files Browse the repository at this point in the history
This is cheating.  We should implement it in rustls.
  • Loading branch information
ctz committed Apr 9, 2024
1 parent 517a530 commit 6b64640
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
4 changes: 2 additions & 2 deletions rustls-libssl/MATRIX.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
| `SSL_CTX_set_recv_max_early_data` | | | |
| `SSL_CTX_set_security_callback` | | | |
| `SSL_CTX_set_security_level` | | | |
| `SSL_CTX_set_session_id_context` | | :white_check_mark: | :exclamation: [^stub] |
| `SSL_CTX_set_session_id_context` | | :white_check_mark: | :white_check_mark: |
| `SSL_CTX_set_session_ticket_cb` | | | |
| `SSL_CTX_set_srp_cb_arg` [^deprecatedin_3_0] [^srp] | | | |
| `SSL_CTX_set_srp_client_pwd_callback` [^deprecatedin_3_0] [^srp] | | | |
Expand Down Expand Up @@ -461,7 +461,7 @@
| `SSL_set_security_callback` | | | |
| `SSL_set_security_level` | | | |
| `SSL_set_session` | :white_check_mark: | :white_check_mark: | :exclamation: [^stub] |
| `SSL_set_session_id_context` | | | :exclamation: [^stub] |
| `SSL_set_session_id_context` | | | :white_check_mark: |
| `SSL_set_session_secret_cb` | | | |
| `SSL_set_session_ticket_ext` | | | |
| `SSL_set_session_ticket_ext_cb` | | | |
Expand Down
41 changes: 24 additions & 17 deletions rustls-libssl/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,18 @@ entry! {
}
}

entry! {
pub fn _SSL_CTX_set_session_id_context(
_ctx: *mut SSL_CTX,
_sid_ctx: *const c_uchar,
_sid_ctx_len: c_uint,
) -> c_int {
// TODO: we should implement this in rustls
log::warn!("SSL_CTX_set_session_id_context returning success, but NYI");
C_INT_SUCCESS
}
}

impl Castable for SSL_CTX {
type Ownership = OwnershipArc;
type RustType = Mutex<SSL_CTX>;
Expand Down Expand Up @@ -1527,6 +1539,18 @@ entry! {
}
}

entry! {
pub fn _SSL_set_session_id_context(
_ssl: *mut SSL,
_sid_ctx: *const c_uchar,
_sid_ctx_len: c_uint,
) -> c_int {
// TODO: we should implement this in rustls
log::warn!("SSL_set_session_id_context returning success, but NYI");
C_INT_SUCCESS
}
}

impl Castable for SSL {
type Ownership = OwnershipArc;
type RustType = Mutex<SSL>;
Expand Down Expand Up @@ -1816,23 +1840,6 @@ entry_stub! {
pub type SSL_CTX_sess_remove_cb =
Option<unsafe extern "C" fn(ctx: *mut SSL_CTX, sess: *mut SSL_SESSION)>;

entry_stub! {
pub fn _SSL_CTX_set_session_id_context(
_ctx: *mut SSL_CTX,
_sid_ctx: *const c_uchar,
_sid_ctx_len: c_uint,
) -> c_int;
}

entry_stub! {

pub fn _SSL_set_session_id_context(
_ssl: *mut SSL,
_sid_ctx: *const c_uchar,
_sid_ctx_len: c_uint,
) -> c_int;
}

entry_stub! {
pub fn _SSL_CTX_set_keylog_callback(_ctx: *mut SSL_CTX, _cb: SSL_CTX_keylog_cb_func);
}
Expand Down

0 comments on commit 6b64640

Please sign in to comment.