From 4ea6739d58d68b04d491c25b41bb8a5dfd14192f Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Sat, 21 Mar 2026 07:53:51 +0100 Subject: [PATCH] [zep fromlist] psa_crypto.c: Fix ifdefs to avoid build warning Add a couple of missing ifdefs to avoid having unreachable code with AT_LEAST_ONE_BUILTIN_KDF not defined, which otherwise causes a build warning with clang. Signed-off-by: Alberto Escolar Piedras Upstream PR #: 723 --- core/psa_crypto.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/psa_crypto.c b/core/psa_crypto.c index f154e7eddf..40cd29d204 100644 --- a/core/psa_crypto.c +++ b/core/psa_crypto.c @@ -6958,7 +6958,9 @@ static int psa_key_derivation_allows_free_form_secret_input( psa_status_t psa_key_derivation_setup(psa_key_derivation_operation_t *operation, psa_algorithm_t alg) { +#if defined(AT_LEAST_ONE_BUILTIN_KDF) psa_status_t status; +#endif if (operation->alg != 0) { return PSA_ERROR_BAD_STATE; @@ -6991,10 +6993,12 @@ psa_status_t psa_key_derivation_setup(psa_key_derivation_operation_t *operation, return PSA_ERROR_INVALID_ARGUMENT; } +#if defined(AT_LEAST_ONE_BUILTIN_KDF) if (status == PSA_SUCCESS) { operation->alg = alg; } return status; +#endif /* AT_LEAST_ONE_BUILTIN_KDF */ } #if defined(BUILTIN_ALG_ANY_HKDF)