pub unsafe extern "C" fn s2n_config_get_supported_groups(
    config: *mut s2n_config,
    groups: *mut u16,
    groups_count_max: u16,
    groups_count: *mut u16
) -> i32
Expand description

Retrieves the list of supported groups configured by the security policy associated with config.

The retrieved list of groups will contain all of the supported groups for a security policy that are compatible with the build of s2n-tls. For instance, PQ kem groups that are not supported by the linked libcrypto will not be written. Otherwise, all of the supported groups configured for the security policy will be written. This API can be used with the s2n_client_hello_get_supported_groups() API as a means of comparing compatibility between a client and server.

IANA values for each of the supported groups are written to the provided groups array, and groups_count is set to the number of written 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 supported groups configured by the security policy, this function will error.

Note that this API retrieves only the groups from a security policy that are available to negotiate via the supported groups extension, and does not return TLS 1.2 PQ kem groups that are negotiated in the supported PQ kem parameters extension.

@param config A pointer to the s2n_config object from which the supported groups will be retrieved. @param groups The array to populate with the supported groups. @param groups_count_max The maximum number of supported groups that can fit in the groups array. @param groups_count Set to the number of supported groups written to groups. @returns S2N_SUCCESS on success. S2N_FAILURE on failure.