diff options
author | Ricardo Salveti <ricardo@foundries.io> | 2020-07-23 22:59:56 -0300 |
---|---|---|
committer | Jérôme Forissier <jerome@forissier.org> | 2020-07-31 17:26:33 +0200 |
commit | 9c86da3cf9edc0eaeff03b01299d78c9309b2299 (patch) | |
tree | b2c333f014c5b2c8d6bc1a8d191a3a0fd05a2117 | |
parent | ce9a20c120ffc0348421d0d6778968bdcdbb7f60 (diff) |
libutee: TEE_AsymmetricSignDigest support 0 signature len
User can call TEE_AsymmetricSignDigest with a NULL signature and a valid
zero signatureLen in order to discover the size of the required
signature buffer (function should then return TEE_ERROR_SHORT_BUFFER and
update signatureLen with the required amount).
Signed-off-by: Ricardo Salveti <ricardo@foundries.io>
Reviewed-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
-rw-r--r-- | lib/libutee/tee_api_operations.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libutee/tee_api_operations.c b/lib/libutee/tee_api_operations.c index 83542a6b..6789cf53 100644 --- a/lib/libutee/tee_api_operations.c +++ b/lib/libutee/tee_api_operations.c @@ -1705,7 +1705,7 @@ TEE_Result TEE_AsymmetricSignDigest(TEE_OperationHandle operation, if (operation == TEE_HANDLE_NULL || (digest == NULL && digestLen != 0) || - signature == NULL || signatureLen == NULL) + !signatureLen || (!signature && *signatureLen != 0)) TEE_Panic(0); if (params == NULL && paramCount != 0) TEE_Panic(0); |