mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-05-11 06:28:17 +02:00
Add implementation of psa_crypto_copy_and_free()
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
@@ -8519,4 +8519,18 @@ error:
|
||||
return ret;
|
||||
}
|
||||
|
||||
psa_status_t psa_crypto_copy_and_free(psa_crypto_buffer_copy_t *buffers)
|
||||
{
|
||||
if (buffers->output != NULL) {
|
||||
memcpy(buffers->output_original, buffers->output, buffers->output_len);
|
||||
}
|
||||
|
||||
mbedtls_free(buffers->input);
|
||||
buffers->input = NULL;
|
||||
mbedtls_free(buffers->output);
|
||||
buffers->output = NULL;
|
||||
|
||||
return PSA_SUCCESS;
|
||||
}
|
||||
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
||||
Reference in New Issue
Block a user