Type Alias s2n_tls_sys::s2n_psk_selection_callback
source · pub type s2n_psk_selection_callback = Option<unsafe extern "C" fn(conn: *mut s2n_connection, context: *mut c_void, psk_list: *mut s2n_offered_psk_list) -> c_int>;
Expand description
Callback function to select a PSK from a list of offered PSKs. Use this callback to implement custom PSK selection logic. The s2n-tls default PSK selection logic chooses the first matching PSK from the list of offered PSKs sent by the client.
§Safety
context
is a void pointer and the caller is responsible for ensuring it is cast to the correct type.
After the completion of this callback, the pointer to psk_list
is invalid.
@param conn A pointer to the s2n_connection object. @param context A pointer to a context for the caller to pass state to the callback, if needed. @param psk_list A pointer to the offered PSK list being read.
Aliased Type§
enum s2n_psk_selection_callback {
None,
Some(unsafe extern "C" fn(_: *mut s2n_connection, _: *mut c_void, _: *mut s2n_offered_psk_list) -> i32),
}
Variants§
None
No value.
Some(unsafe extern "C" fn(_: *mut s2n_connection, _: *mut c_void, _: *mut s2n_offered_psk_list) -> i32)
Some value of type T
.