Merge pull request #8320 from valeriosetti/issue8263
Fix dependencies of mbedtls_pk_ec_ro and mbedtls_pk_ec_rw
This commit is contained in:
commit
f6f4695824
2 changed files with 8 additions and 6 deletions
|
@ -44,7 +44,7 @@
|
||||||
psa_pk_status_to_mbedtls)
|
psa_pk_status_to_mbedtls)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MBEDTLS_PK_HAVE_ECC_KEYS)
|
#if !defined(MBEDTLS_PK_USE_PSA_EC_DATA)
|
||||||
/**
|
/**
|
||||||
* Public function mbedtls_pk_ec() can be used to get direct access to the
|
* Public function mbedtls_pk_ec() can be used to get direct access to the
|
||||||
* wrapped ecp_keypair structure pointed to the pk_ctx. However this is not
|
* wrapped ecp_keypair structure pointed to the pk_ctx. However this is not
|
||||||
|
@ -80,7 +80,9 @@ static inline mbedtls_ecp_keypair *mbedtls_pk_ec_rw(const mbedtls_pk_context pk)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* !MBEDTLS_PK_USE_PSA_EC_DATA */
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_PK_HAVE_ECC_KEYS)
|
||||||
static inline mbedtls_ecp_group_id mbedtls_pk_get_group_id(const mbedtls_pk_context *pk)
|
static inline mbedtls_ecp_group_id mbedtls_pk_get_group_id(const mbedtls_pk_context *pk)
|
||||||
{
|
{
|
||||||
mbedtls_ecp_group_id id;
|
mbedtls_ecp_group_id id;
|
||||||
|
|
|
@ -676,7 +676,7 @@ static int ssl_check_key_curve(mbedtls_pk_context *pk,
|
||||||
uint16_t *curves_tls_id)
|
uint16_t *curves_tls_id)
|
||||||
{
|
{
|
||||||
uint16_t *curr_tls_id = curves_tls_id;
|
uint16_t *curr_tls_id = curves_tls_id;
|
||||||
mbedtls_ecp_group_id grp_id = mbedtls_pk_ec_ro(*pk)->grp.id;
|
mbedtls_ecp_group_id grp_id = mbedtls_pk_get_group_id(pk);
|
||||||
mbedtls_ecp_group_id curr_grp_id;
|
mbedtls_ecp_group_id curr_grp_id;
|
||||||
|
|
||||||
while (*curr_tls_id != 0) {
|
while (*curr_tls_id != 0) {
|
||||||
|
@ -2600,9 +2600,9 @@ static int ssl_write_certificate_request(mbedtls_ssl_context *ssl)
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_KEY_EXCHANGE_CERT_REQ_ALLOWED_ENABLED */
|
#endif /* MBEDTLS_KEY_EXCHANGE_CERT_REQ_ALLOWED_ENABLED */
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_PSA_CRYPTO) && \
|
#if (defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \
|
||||||
(defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \
|
|
||||||
defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED))
|
defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED))
|
||||||
|
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||||
MBEDTLS_CHECK_RETURN_CRITICAL
|
MBEDTLS_CHECK_RETURN_CRITICAL
|
||||||
static int ssl_get_ecdh_params_from_cert(mbedtls_ssl_context *ssl)
|
static int ssl_get_ecdh_params_from_cert(mbedtls_ssl_context *ssl)
|
||||||
{
|
{
|
||||||
|
@ -2712,8 +2712,7 @@ static int ssl_get_ecdh_params_from_cert(mbedtls_ssl_context *ssl)
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#elif defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \
|
#else /* MBEDTLS_USE_PSA_CRYPTO */
|
||||||
defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED)
|
|
||||||
MBEDTLS_CHECK_RETURN_CRITICAL
|
MBEDTLS_CHECK_RETURN_CRITICAL
|
||||||
static int ssl_get_ecdh_params_from_cert(mbedtls_ssl_context *ssl)
|
static int ssl_get_ecdh_params_from_cert(mbedtls_ssl_context *ssl)
|
||||||
{
|
{
|
||||||
|
@ -2739,6 +2738,7 @@ static int ssl_get_ecdh_params_from_cert(mbedtls_ssl_context *ssl)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||||
#endif /* MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) ||
|
#endif /* MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) ||
|
||||||
MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */
|
MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue