1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-08 17:42:09 +03:00

Remove internal helper mbedtls_ssl_get_groups()

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard
2025-01-14 12:23:56 +01:00
parent 6b720161ca
commit 6402c35eca
5 changed files with 6 additions and 16 deletions

View File

@@ -222,7 +222,7 @@ static int ssl_write_supported_groups_ext(mbedtls_ssl_context *ssl,
unsigned char *p = buf;
unsigned char *named_group_list; /* Start of named_group_list */
size_t named_group_list_len; /* Length of named_group_list */
const uint16_t *group_list = mbedtls_ssl_get_groups(ssl);
const uint16_t *group_list = ssl->conf->group_list;
*out_len = 0;

View File

@@ -2267,16 +2267,6 @@ int mbedtls_ssl_get_handshake_transcript(mbedtls_ssl_context *ssl,
size_t dst_len,
size_t *olen);
/*
* Return supported groups.
*
* In future, invocations can be changed to ssl->conf->group_list.
*/
static inline const void *mbedtls_ssl_get_groups(const mbedtls_ssl_context *ssl)
{
return ssl->conf->group_list;
}
/*
* Helper functions for NamedGroup.
*/
@@ -2319,7 +2309,7 @@ static inline int mbedtls_ssl_tls13_named_group_is_ffdh(uint16_t named_group)
static inline int mbedtls_ssl_named_group_is_offered(
const mbedtls_ssl_context *ssl, uint16_t named_group)
{
const uint16_t *group_list = mbedtls_ssl_get_groups(ssl);
const uint16_t *group_list = ssl->conf->group_list;
if (group_list == NULL) {
return 0;

View File

@@ -6119,7 +6119,7 @@ unsigned char mbedtls_ssl_hash_from_md_alg(int md)
*/
int mbedtls_ssl_check_curve_tls_id(const mbedtls_ssl_context *ssl, uint16_t tls_id)
{
const uint16_t *group_list = mbedtls_ssl_get_groups(ssl);
const uint16_t *group_list = ssl->conf->group_list;
if (group_list == NULL) {
return -1;

View File

@@ -2966,7 +2966,7 @@ static int ssl_prepare_server_key_exchange(mbedtls_ssl_context *ssl,
* } ServerECDHParams;
*/
uint16_t *curr_tls_id = ssl->handshake->curves_tls_id;
const uint16_t *group_list = mbedtls_ssl_get_groups(ssl);
const uint16_t *group_list = ssl->conf->group_list;
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
size_t len = 0;

View File

@@ -216,7 +216,7 @@ static int ssl_tls13_get_default_group_id(mbedtls_ssl_context *ssl,
#if defined(PSA_WANT_ALG_ECDH) || defined(PSA_WANT_ALG_FFDH)
const uint16_t *group_list = mbedtls_ssl_get_groups(ssl);
const uint16_t *group_list = ssl->conf->group_list;
/* Pick first available ECDHE group compatible with TLS 1.3 */
if (group_list == NULL) {
return MBEDTLS_ERR_SSL_BAD_CONFIG;
@@ -382,7 +382,7 @@ static int ssl_tls13_parse_hrr_key_share_ext(mbedtls_ssl_context *ssl,
int selected_group;
int found = 0;
const uint16_t *group_list = mbedtls_ssl_get_groups(ssl);
const uint16_t *group_list = ssl->conf->group_list;
if (group_list == NULL) {
return MBEDTLS_ERR_SSL_BAD_CONFIG;
}