From 46d7faf195c8e160de5a641e218417bf5e399d60 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 23 Sep 2019 19:22:55 +0200 Subject: [PATCH] Don't jump past a variable declaration This is valid C99 (since the variable in question is not a VLA and is not used) but not accepted by IAR 8.20. --- library/psa_crypto.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 07c6261d6..9aa33df99 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -5104,12 +5104,13 @@ static psa_status_t psa_key_derivation_input_internal( const uint8_t *data, size_t data_length ) { - psa_status_t status = psa_key_derivation_check_input_type( step, key_type ); + psa_status_t status; + psa_algorithm_t kdf_alg = psa_key_derivation_get_kdf_alg( operation ); + + status = psa_key_derivation_check_input_type( step, key_type ); if( status != PSA_SUCCESS ) goto exit; - psa_algorithm_t kdf_alg = psa_key_derivation_get_kdf_alg( operation ); - #if defined(MBEDTLS_MD_C) if( PSA_ALG_IS_HKDF( kdf_alg ) ) {