1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-19 05:43:14 +03:00

pk: fix library code for using the new opaque key solution

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti
2023-04-28 15:26:11 +02:00
parent e00954d0ed
commit 048cd44f77
5 changed files with 14 additions and 20 deletions

View File

@ -595,8 +595,7 @@ static void test_ssl_endpoint_certificate_free(mbedtls_test_ssl_endpoint *ep)
if (cert->pkey != NULL) {
#if defined(MBEDTLS_USE_PSA_CRYPTO)
if (mbedtls_pk_get_type(cert->pkey) == MBEDTLS_PK_OPAQUE) {
mbedtls_svc_key_id_t *key_slot = cert->pkey->pk_ctx;
psa_destroy_key(*key_slot);
psa_destroy_key(cert->pkey->opaque_id);
}
#endif
mbedtls_pk_free(cert->pkey);