Skip to content

Commit

Permalink
[Review] crypto: don't check hash size when the main algorithm is ECDSA
Browse files Browse the repository at this point in the history
Use 'break' instead of 'goto out'.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
  • Loading branch information
jforissier committed Apr 26, 2017
1 parent a7a9aa4 commit 25d6939
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/tee/tee_svc_cryp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3492,10 +3492,10 @@ TEE_Result syscall_asymm_verify(unsigned long state,
hash_algo = TEE_DIGEST_HASH_TO_ALGO(cs->algo);
res = tee_hash_get_digest_size(hash_algo, &hash_size);
if (res != TEE_SUCCESS)
goto out;
break;
if (data_len != hash_size) {
res = TEE_ERROR_BAD_PARAMETERS;
goto out;
break;
}
salt_len = pkcs1_get_salt_len(params, num_params, hash_size);
if (!crypto_ops.acipher.rsassa_verify) {
Expand All @@ -3511,7 +3511,7 @@ TEE_Result syscall_asymm_verify(unsigned long state,
hash_algo = TEE_DIGEST_HASH_TO_ALGO(cs->algo);
res = tee_hash_get_digest_size(hash_algo, &hash_size);
if (res != TEE_SUCCESS)
goto out;
break;
/*
* Depending on the DSA algorithm (NIST), the digital signature
* output size may be truncated to the size of a key pair
Expand All @@ -3520,7 +3520,7 @@ TEE_Result syscall_asymm_verify(unsigned long state,
*/
if (data_len > hash_size) {
res = TEE_ERROR_BAD_PARAMETERS;
goto out;
break;
}
if (!crypto_ops.acipher.dsa_verify) {
res = TEE_ERROR_NOT_IMPLEMENTED;
Expand Down

0 comments on commit 25d6939

Please sign in to comment.