Skip to content

Commit

Permalink
xtest: return out-buffer sizes unconditionally
Browse files Browse the repository at this point in the history
In ta_crypt_cmd_cipher_update(), ta_crypt_cmd_cipher_do_final(),
ta_crypt_cmd_ae_update(), ta_crypt_cmd_ae_encrypt_final(), and
ta_crypt_cmd_ae_decrypt_final(), always return out-buffer sizes even if
the function doesn't return TEEC_SUCCESS.

Signed-off-by: Jens Wiklander <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
  • Loading branch information
jenswi-linaro authored and jforissier committed Jun 17, 2024
1 parent 576726a commit 8281d64
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions host/xtest/regression_4000.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@ static TEEC_Result ta_crypt_cmd_cipher_update(ADBG_Case_t *c, TEEC_Session *s,
ret_orig);
}

if (res == TEEC_SUCCESS)
*dst_len = op.params[2].tmpref.size;
*dst_len = op.params[2].tmpref.size;

return res;
}
Expand Down Expand Up @@ -437,8 +436,7 @@ static TEEC_Result ta_crypt_cmd_cipher_do_final(ADBG_Case_t *c,
ret_orig);
}

if (res == TEEC_SUCCESS)
*dst_len = op.params[2].tmpref.size;
*dst_len = op.params[2].tmpref.size;

return res;
}
Expand Down Expand Up @@ -564,8 +562,7 @@ static TEEC_Result ta_crypt_cmd_ae_update(ADBG_Case_t *c,
ret_orig);
}

if (res == TEEC_SUCCESS)
*dst_len = op.params[2].tmpref.size;
*dst_len = op.params[2].tmpref.size;

return res;
}
Expand Down Expand Up @@ -607,10 +604,8 @@ static TEEC_Result ta_crypt_cmd_ae_encrypt_final(ADBG_Case_t *c,
ret_orig);
}

if (res == TEEC_SUCCESS) {
*dst_len = op.params[2].tmpref.size;
*tag_len = op.params[3].tmpref.size;
}
*dst_len = op.params[2].tmpref.size;
*tag_len = op.params[3].tmpref.size;

return res;
}
Expand Down Expand Up @@ -651,8 +646,7 @@ static TEEC_Result ta_crypt_cmd_ae_decrypt_final(ADBG_Case_t *c,
ret_orig);
}

if (res == TEEC_SUCCESS)
*dst_len = op.params[2].tmpref.size;
*dst_len = op.params[2].tmpref.size;

return res;
}
Expand Down

0 comments on commit 8281d64

Please sign in to comment.