Skip to content

Commit adf2ec8

Browse files
committed
Output diagnostic for SSL_CTX_set_msg_callback use
This changes the behaviour from adding an error to the error stack, to quietly logging.
1 parent 42ca6f6 commit adf2ec8

2 files changed

Lines changed: 26 additions & 24 deletions

File tree

MATRIX.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
| `SSL_CTX_set_info_callback` | | :white_check_mark: | :white_check_mark: | :white_check_mark: |
162162
| `SSL_CTX_set_keylog_callback` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :exclamation: [^stub] |
163163
| `SSL_CTX_set_max_early_data` | | :white_check_mark: | | :white_check_mark: |
164-
| `SSL_CTX_set_msg_callback` | :white_check_mark: | | :white_check_mark: | :exclamation: [^stub] |
164+
| `SSL_CTX_set_msg_callback` | :white_check_mark: | | :white_check_mark: | :white_check_mark: |
165165
| `SSL_CTX_set_next_proto_select_cb` [^nextprotoneg] | :white_check_mark: | | :white_check_mark: | :exclamation: [^stub] |
166166
| `SSL_CTX_set_next_protos_advertised_cb` [^nextprotoneg] | | :white_check_mark: | :white_check_mark: | :exclamation: [^stub] |
167167
| `SSL_CTX_set_not_resumable_session_callback` | | | | |
@@ -442,7 +442,7 @@
442442
| `SSL_set_hostflags` | | | | |
443443
| `SSL_set_info_callback` | | | | :white_check_mark: |
444444
| `SSL_set_max_early_data` | | :white_check_mark: | :white_check_mark: | :white_check_mark: |
445-
| `SSL_set_msg_callback` | | :white_check_mark: | :white_check_mark: | :exclamation: [^stub] |
445+
| `SSL_set_msg_callback` | | :white_check_mark: | :white_check_mark: | :white_check_mark: |
446446
| `SSL_set_not_resumable_session_callback` | | | | |
447447
| `SSL_set_num_tickets` | | | | :white_check_mark: |
448448
| `SSL_set_options` | | :white_check_mark: | | :white_check_mark: |

src/entry.rs

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,30 @@ entry! {
712712
pub type SSL_CTX_info_callback_func =
713713
Option<unsafe extern "C" fn(ssl: *mut SSL, type_: c_int, val: c_int)>;
714714

715+
entry! {
716+
pub fn _SSL_CTX_set_msg_callback(_ctx: *mut SSL_CTX, _cb: SSL_CTX_msg_cb_func) {
717+
log::warn!("SSL_CTX_set_msg_callback not implemented; callback will not be called");
718+
}
719+
}
720+
721+
entry! {
722+
pub fn _SSL_set_msg_callback(_ssl: *mut SSL, _cb: SSL_CTX_msg_cb_func) {
723+
log::warn!("SSL_set_msg_callback not implemented; callback will not be called");
724+
}
725+
}
726+
727+
pub type SSL_CTX_msg_cb_func = Option<
728+
unsafe extern "C" fn(
729+
write_p: c_int,
730+
version: c_int,
731+
content_type: c_int,
732+
buf: *const c_void,
733+
len: usize,
734+
ssl: *mut SSL,
735+
arg: *mut c_void,
736+
),
737+
>;
738+
715739
entry! {
716740
pub fn _SSL_CTX_get_max_early_data(ctx: *const SSL_CTX) -> u32 {
717741
try_clone_arc!(ctx).get().get_max_early_data()
@@ -2320,28 +2344,6 @@ entry_stub! {
23202344
) -> c_int;
23212345
}
23222346

2323-
// no individual message logging
2324-
2325-
entry_stub! {
2326-
pub fn _SSL_CTX_set_msg_callback(_ctx: *mut SSL_CTX, _cb: SSL_CTX_msg_cb_func);
2327-
}
2328-
2329-
entry_stub! {
2330-
pub fn _SSL_set_msg_callback(_ssl: *mut SSL, _cb: SSL_CTX_msg_cb_func);
2331-
}
2332-
2333-
pub type SSL_CTX_msg_cb_func = Option<
2334-
unsafe extern "C" fn(
2335-
write_p: c_int,
2336-
version: c_int,
2337-
content_type: c_int,
2338-
buf: *const c_void,
2339-
len: usize,
2340-
ssl: *mut SSL,
2341-
arg: *mut c_void,
2342-
),
2343-
>;
2344-
23452347
// no NPN (obsolete precursor to ALPN)
23462348

23472349
entry_stub! {

0 commit comments

Comments
 (0)