From 39d54e1fb15ea4a342e1c8c08922f662a5962a57 Mon Sep 17 00:00:00 2001 From: Waleed Elmelegy Date: Wed, 20 Nov 2024 15:08:52 +0000 Subject: [PATCH] Prevent a warning in case PSA_VENDOR_ECC_MAX_CURVE_BITS is set to 0 Signed-off-by: Waleed Elmelegy --- tf-psa-crypto/core/psa_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tf-psa-crypto/core/psa_crypto.c b/tf-psa-crypto/core/psa_crypto.c index e319935a1..1899114e3 100644 --- a/tf-psa-crypto/core/psa_crypto.c +++ b/tf-psa-crypto/core/psa_crypto.c @@ -8184,7 +8184,7 @@ psa_status_t psa_generate_key_iop_complete( { #if defined(MBEDTLS_ECP_RESTARTABLE) psa_status_t status; - uint8_t key_data[PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS)] = { 0 }; + uint8_t key_data[PSA_KEY_EXPORT_ECC_KEY_PAIR_MAX_SIZE(PSA_VENDOR_ECC_MAX_CURVE_BITS)+1] = { 0 }; size_t key_len = 0; if (operation->id == 0 || operation->error_occurred) {