1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Don't use mbedtls_pk_ec in our own code

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2024-02-01 20:48:04 +01:00
parent 7e353ba37a
commit ae2668be97
2 changed files with 2 additions and 2 deletions

View File

@ -475,7 +475,7 @@ int mbedtls_pk_get_psa_attributes(const mbedtls_pk_context *pk,
size_t bits = psa_get_key_bits(&old_attributes); size_t bits = psa_get_key_bits(&old_attributes);
psa_ecc_family_t family = PSA_KEY_TYPE_ECC_GET_FAMILY(old_type); psa_ecc_family_t family = PSA_KEY_TYPE_ECC_GET_FAMILY(old_type);
#else #else
mbedtls_ecp_keypair *ec = mbedtls_pk_ec(*pk); const mbedtls_ecp_keypair *ec = mbedtls_pk_ec_ro(*pk);
int has_private = (ec->d.n != 0); int has_private = (ec->d.n != 0);
size_t bits = 0; size_t bits = 0;
psa_ecc_family_t family = psa_ecc_family_t family =

View File

@ -287,7 +287,7 @@ static int pk_setup_for_type(mbedtls_pk_type_t pk_type, int want_pair,
pk->pub_raw, pk->pub_raw_len, pk->pub_raw, pk->pub_raw_len,
&pk->priv_id)); &pk->priv_id));
#else #else
mbedtls_ecp_keypair *ec = mbedtls_pk_ec(*pk); mbedtls_ecp_keypair *ec = mbedtls_pk_ec_rw(*pk);
mbedtls_mpi_free(&ec->d); mbedtls_mpi_free(&ec->d);
#endif #endif
} }