pk: fix: clear buffer holding raw EC private key on exit

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti 2023-04-26 13:08:56 +02:00
parent c8b7865612
commit 2c50526476

View file

@ -908,6 +908,8 @@ int mbedtls_pk_wrap_as_opaque(mbedtls_pk_context *pk,
return PSA_PK_TO_MBEDTLS_ERR(status);
}
mbedtls_platform_zeroize(d, sizeof(d));
/* make PK context wrap the key slot */
mbedtls_pk_free(pk);
mbedtls_pk_init(pk);