library: ssl: rework macro to define known TLS ID <-> group name list

- let the macro be an initializer for the array of known TLS IDs, not
  a variable declarator;
- last item's group name is NULL, not an empty string
- change then name of the macro from MBEDTLS_TLS_ID_GROUP_NAME_TABLE to
  MBEDTLS_SSL_IANA_TLS_GROUPS_INFO
- define a new public structure "mbedtls_ssl_iana_tls_group_info_t" to
  hold each element of the table and that can be used the go over the
  list from user code.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti
2026-01-27 00:36:17 +01:00
parent c87adb64f2
commit fb317afa9f
3 changed files with 28 additions and 13 deletions

View File

@@ -5850,7 +5850,8 @@ uint16_t mbedtls_ssl_get_tls_id_from_ecp_group_id(mbedtls_ecp_group_id grp_id)
}
#if defined(MBEDTLS_DEBUG_C)
static MBEDTLS_TLS_ID_GROUP_NAME_TABLE(tls_id_curve_name_table);
static
mbedtls_ssl_iana_tls_group_info_t tls_id_curve_name_table[] = MBEDTLS_SSL_IANA_TLS_GROUPS_INFO;
const char *mbedtls_ssl_get_curve_name_from_tls_id(uint16_t tls_id)
{