mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-12 03:40:04 +00:00
Add buffer copying to psa_aead_update()
Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
parent
25dac6edc1
commit
2914fac28a
@ -5109,14 +5109,21 @@ exit:
|
|||||||
/* Encrypt or decrypt a message fragment in an active multipart AEAD
|
/* Encrypt or decrypt a message fragment in an active multipart AEAD
|
||||||
operation.*/
|
operation.*/
|
||||||
psa_status_t psa_aead_update(psa_aead_operation_t *operation,
|
psa_status_t psa_aead_update(psa_aead_operation_t *operation,
|
||||||
const uint8_t *input,
|
const uint8_t *input_external,
|
||||||
size_t input_length,
|
size_t input_length,
|
||||||
uint8_t *output,
|
uint8_t *output_external,
|
||||||
size_t output_size,
|
size_t output_size,
|
||||||
size_t *output_length)
|
size_t *output_length)
|
||||||
{
|
{
|
||||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||||
|
|
||||||
|
|
||||||
|
LOCAL_INPUT_DECLARE(input_external, input);
|
||||||
|
LOCAL_OUTPUT_DECLARE(output_external, output);
|
||||||
|
|
||||||
|
LOCAL_INPUT_ALLOC(input_external, input_length, input);
|
||||||
|
LOCAL_OUTPUT_ALLOC(output_external, output_size, output);
|
||||||
|
|
||||||
*output_length = 0;
|
*output_length = 0;
|
||||||
|
|
||||||
if (operation->id == 0) {
|
if (operation->id == 0) {
|
||||||
@ -5163,6 +5170,9 @@ exit:
|
|||||||
psa_aead_abort(operation);
|
psa_aead_abort(operation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOCAL_INPUT_FREE(input_external, input);
|
||||||
|
LOCAL_OUTPUT_FREE(output_external, output);
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user