Skip to content

Commit 66e7711

Browse files
tomi-fontnordicjm
authored andcommitted
nrf_security: drivers: cracen: fix AEAD w/ zero-sized input
psa_aead_encrypt() would fail, returning PSA_ERROR_BUFFER_TOO_SMALL, because ciphertext_length wouldn't be assigned and have a random value. Signed-off-by: Tomi Fontanilles <[email protected]>
1 parent bb3b7d0 commit 66e7711

File tree

1 file changed

+1
-0
lines changed
  • subsys/nrf_security/src/drivers/cracen/cracenpsa/src

1 file changed

+1
-0
lines changed

subsys/nrf_security/src/drivers/cracen/cracenpsa/src/aead.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ psa_status_t cracen_aead_update(cracen_aead_operation_t *operation, const uint8_
516516
* of AD buffered before creating/verifying the tag
517517
*/
518518
if (input_length == 0) {
519+
*output_length = 0;
519520
return PSA_SUCCESS;
520521
}
521522

0 commit comments

Comments
 (0)