mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-19 00:40:14 +00:00
The documentation of mbedtls_pk_wrap_as_opaque is quite clear: * \param handle Output: a PSA key handle. * It's the caller's responsibility to call * psa_destroy_key() on that handle after calling * mbedtls_pk_free() on the PK context. But the test failed to call psa_destroy_key(). While at it, also use PSA_DONE(): it ensures that if we fail to destroy the key, we'll get an explicit error message about it without the need for valgrind. This is a preliminary to adding a valgrind-based test for constant-flow code: we need to make sure the rest of the tests are fully valgrind-clean, which they weren't. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>