library: ssl: add public function to retrieve the list of supported groups

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti
2026-01-21 15:24:03 +01:00
parent 069cfbd43c
commit 0c8b25a684
2 changed files with 23 additions and 0 deletions

View File

@@ -3660,6 +3660,24 @@ void mbedtls_ssl_conf_psk_cb(mbedtls_ssl_config *conf,
#endif /* MBEDTLS_SSL_SRV_C */
#endif /* MBEDTLS_SSL_HANDSHAKE_WITH_PSK_ENABLED */
/**
* \brief Return the list of supported groups (curves and finite fields).
*
* \note The returned list is ordered in ascending order of resource
* usage. This follows the same pattern of the default list being
* used when mbedtls_ssl_conf_groups() is not called.
*
* \note The returned list represents supported groups in the current build
* configuration, not the one set by mbedtls_ssl_conf_groups().
*
* \note The returned list is static so the user doesn't need to worry
* about it being freed.
*
* \return The list made of IANA NamedGroups IDs (MBEDTLS_SSL_IANA_TLS_GROUP_xxx)
* with the last item always being MBEDTLS_SSL_IANA_TLS_GROUP_NONE.
*/
const uint16_t *mbedtls_ssl_get_supported_group_list(void);
/**
* \brief Set the allowed groups in order of preference.
*

View File

@@ -2360,6 +2360,11 @@ void mbedtls_ssl_conf_sig_algs(mbedtls_ssl_config *conf,
}
#endif /* MBEDTLS_SSL_HANDSHAKE_WITH_CERT_ENABLED */
const uint16_t *mbedtls_ssl_get_supported_group_list(void)
{
return ssl_preset_default_groups;
}
/*
* Set the allowed groups
*/