mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-17 11:43:37 +00:00
Add implementation of psa_crypto_copy_and_free()
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
9700876520
commit
f4bbb632cd
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user