Skip to content

Commit

Permalink
libutee: AES CTS fix
Browse files Browse the repository at this point in the history
Ad-hoc fix for regressions introduced by [1].
Tested on HiKey using latest optee_test including GlobalPlatform tests
(32/64-bit TEE core, 32/64-bit libutee, with/without ARMv8 CE
acceleration).

Fixes: b1ecda7 ("libutee: fix off-by-one error in tee_buffer_update()") [1]
Fixes: OP-TEE#1305
Signed-off-by: Jerome Forissier <[email protected]>
  • Loading branch information
jforissier committed Jan 25, 2017
1 parent 540bdf4 commit 9bc0a16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/libutee/tee_api_operations.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,10 @@ static TEE_Result tee_buffer_update(

if (slen >= (buffer_size + buffer_left)) {
/* Buffer is empty, feed as much as possible from src */
l = ROUNDUP(slen - buffer_size, op->block_size);
if (op->info.algorithm == TEE_ALG_AES_CTS)
l = ROUNDUP(slen - buffer_size, op->block_size);
else
l = ROUNDUP(slen - buffer_size + 1, op->block_size);

tmp_dlen = dlen;
res = update_func(op->state, src, l, dst, &tmp_dlen);
Expand Down

0 comments on commit 9bc0a16

Please sign in to comment.