Crypto: Support optional inputs in aead_update and aead_update_ad
The PSA APIs psa_aead_update_ad() and psa_aead_update() support
the inputs as optional values (i.e. NULL/zero-length buffers),
hence make sure this case is handled correctly in IPC mode.
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: I1ec39359557921769ca475e6c69fab26cb6ca901
diff --git a/secure_fw/partitions/crypto/crypto_aead.c b/secure_fw/partitions/crypto/crypto_aead.c
index 85ec46b..ded596c 100644
--- a/secure_fw/partitions/crypto/crypto_aead.c
+++ b/secure_fw/partitions/crypto/crypto_aead.c
@@ -468,7 +468,7 @@
psa_status_t status = PSA_SUCCESS;
psa_aead_operation_t *operation = NULL;
- CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 2, 2, out_len, 2, 2);
+ CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 2, out_len, 2, 2);
if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
(out_vec[0].len != sizeof(uint32_t))) {
@@ -517,7 +517,7 @@
psa_status_t status = PSA_SUCCESS;
psa_aead_operation_t *operation = NULL;
- CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 2, 2, out_len, 1, 1);
+ CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 2, out_len, 1, 1);
if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
(out_vec[0].len != sizeof(uint32_t))) {