Skip to content

Commit

Permalink
core: tee_svc_cryp: report RSAES_PKCS1_OAEP_MGF1 bad hash ID
Browse files Browse the repository at this point in the history
Fixes syscall_asymm_operate() to report inconsistent hash algorithm
specified as attribute for TEE_ALG_RSAES_PKCS1_OAEP_MGF1_* operations
as OP-TEE only supports the hash predefined for the request algorithm
TEE_ALG_RSAES_PKCS1_OAEP_MGF1_xxx.

Link: OP-TEE#6143
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
  • Loading branch information
etienne-lms authored and jforissier committed Jun 28, 2023
1 parent 9216643 commit 9ab92de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/tee/tee_svc_cryp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4257,14 +4257,14 @@ TEE_Result syscall_asymm_operate(unsigned long state,
if (params[n].content.ref.length !=
sizeof(hash)) {
res = TEE_ERROR_BAD_PARAMETERS;
break;
goto out;
}
memcpy(&hash, params[n].content.ref.buffer,
sizeof(hash));
if (hash !=
TEE_INTERNAL_HASH_TO_ALGO(cs->algo)) {
res = TEE_ERROR_NOT_SUPPORTED;
break;
goto out;
}
}
}
Expand Down

0 comments on commit 9ab92de

Please sign in to comment.