1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-05 19:35:48 +03:00

ssl_tls: fix proper guards for accelerated ECDH

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti
2023-03-17 17:07:50 +01:00
parent 90df310d89
commit 0c8ec3983e
6 changed files with 24 additions and 24 deletions

View File

@@ -200,7 +200,7 @@ static int ssl_tls13_reset_key_share(mbedtls_ssl_context *ssl)
ssl->handshake->ecdh_psa_privkey = MBEDTLS_SVC_KEY_ID_INIT;
return 0;
} else
#endif /* MBEDTLS_ECDH_C */
#endif /* MBEDTLS_PK_CAN_ECDH */
if (0 /* other KEMs? */) {
/* Do something */
}
@@ -237,7 +237,7 @@ static int ssl_tls13_get_default_group_id(mbedtls_ssl_context *ssl,
#else
((void) ssl);
((void) group_id);
#endif /* MBEDTLS_ECDH_C */
#endif /* MBEDTLS_PK_CAN_ECDH */
/*
* Add DHE named groups here.
@@ -326,7 +326,7 @@ static int ssl_tls13_write_key_share_ext(mbedtls_ssl_context *ssl,
/* Write key_exchange_length */
MBEDTLS_PUT_UINT16_BE(key_exchange_len, group, 2);
} else
#endif /* MBEDTLS_ECDH_C */
#endif /* MBEDTLS_PK_CAN_ECDH */
if (0 /* other KEMs? */) {
/* Do something */
} else {
@@ -375,7 +375,7 @@ static int ssl_tls13_parse_hrr_key_share_ext(mbedtls_ssl_context *ssl,
const unsigned char *buf,
const unsigned char *end)
{
#if defined(MBEDTLS_ECDH_C)
#if defined(MBEDTLS_PK_CAN_ECDH)
const unsigned char *p = buf;
int selected_group;
int found = 0;
@@ -480,7 +480,7 @@ static int ssl_tls13_parse_key_share_ext(mbedtls_ssl_context *ssl,
return MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE;
}
#if defined(MBEDTLS_ECDH_C)
#if defined(MBEDTLS_PK_CAN_ECDH)
if (mbedtls_ssl_tls13_named_group_is_ecdhe(group)) {
if (mbedtls_ssl_get_psa_curve_info_from_tls_id(group, NULL, NULL)
== PSA_ERROR_NOT_SUPPORTED) {
@@ -496,7 +496,7 @@ static int ssl_tls13_parse_key_share_ext(mbedtls_ssl_context *ssl,
return ret;
}
} else
#endif /* MBEDTLS_ECDH_C */
#endif /* MBEDTLS_PK_CAN_ECDH */
if (0 /* other KEMs? */) {
/* Do something */
} else {