diff --git a/library/pk.c b/library/pk.c index 3f28787385..696e7e5072 100644 --- a/library/pk.c +++ b/library/pk.c @@ -475,7 +475,7 @@ int mbedtls_pk_get_psa_attributes(const mbedtls_pk_context *pk, size_t bits = psa_get_key_bits(&old_attributes); psa_ecc_family_t family = PSA_KEY_TYPE_ECC_GET_FAMILY(old_type); #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); size_t bits = 0; psa_ecc_family_t family = diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function index 14d049dfc6..706bb7086e 100644 --- a/tests/suites/test_suite_pk.function +++ b/tests/suites/test_suite_pk.function @@ -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->priv_id)); #else - mbedtls_ecp_keypair *ec = mbedtls_pk_ec(*pk); + mbedtls_ecp_keypair *ec = mbedtls_pk_ec_rw(*pk); mbedtls_mpi_free(&ec->d); #endif }