library: extend mbedtls_ssl_iana_tls_group_info_t structure

Add new field that tells if the corresponding group is supported or not
in the current build.

Test function "test_mbedtls_ssl_get_supported_group_list" is extended
to verify this new feature.

Signed-off-by: Valerio Setti <[email protected]>
This commit is contained in:
Valerio Setti
2026-01-28 10:52:07 +01:00
parent 9b49d5dbde
commit 476a2edea7
2 changed files with 109 additions and 23 deletions
+12 -1
View File
@@ -3580,15 +3580,26 @@ void test_mbedtls_ssl_get_supported_group_list(int iana_group_id, int is_availab
const uint16_t *list = mbedtls_ssl_get_supported_group_list();
int found = 0;
/* First: go through the list returned by mbedtls_ssl_get_supported_group_list() and
* check that the specified group ID is supported/unsupported as expected. */
for (int i = 0; list[i] != MBEDTLS_SSL_IANA_TLS_GROUP_NONE; i++) {
if (list[i] == iana_group_id) {
found = 1;
break;
}
}
TEST_EQUAL(found, is_available);
/* Second: check that supported/unsupported property for the specified group is also
* correctly set in the array initialized by MBEDTLS_SSL_IANA_TLS_GROUP_NONE. */
mbedtls_ssl_iana_tls_group_info_t group_info_table[] = MBEDTLS_SSL_IANA_TLS_GROUPS_INFO;
mbedtls_ssl_iana_tls_group_info_t *ptr;
for (ptr = &group_info_table[0]; ptr->tls_id != MBEDTLS_SSL_IANA_TLS_GROUP_NONE; ptr++) {
if (ptr->tls_id == iana_group_id) {
TEST_EQUAL(ptr->is_supported, is_available);
}
}
exit:;
}
/* END_CASE */