Function s2n_quic_tls::ffi::s2n_client_hello_get_supported_groups
source · pub unsafe extern "C" fn s2n_client_hello_get_supported_groups(
ch: *mut s2n_client_hello,
groups: *mut u16,
groups_count_max: u16,
groups_count: *mut u16
) -> i32
Expand description
Retrieves the supported groups received from the client in the supported groups extension.
IANA values for each of the received supported groups are written to the provided groups
array, and groups_count
is set to the number of received supported groups.
groups_count_max
should be set to the maximum capacity of the groups
array. If
groups_count_max
is less than the number of received supported groups, this function will
error. To determine how large groups
should be in advance, use
s2n_client_hello_get_extension_length()
with the S2N_EXTENSION_SUPPORTED_GROUPS extension
type, and divide the value by 2.
If no supported groups extension was received from the peer, or the received supported groups extension is malformed, this function will error.
@param ch A pointer to the ClientHello. Can be retrieved from a connection via
s2n_connection_get_client_hello()
.
@param groups The array to populate with the received supported groups.
@param groups_count_max The maximum number of supported groups that can fit in the groups
array.
@param groups_count Returns the number of received supported groups.
@returns S2N_SUCCESS on success. S2N_FAILURE on failure.