mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-11 14:50:48 +02:00
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 <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
committed by
Valerio Setti
parent
4eb967981f
commit
c30e6af2cc
@@ -6939,7 +6939,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;
|
||||
@@ -6972,10 +6974,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)
|
||||
|
||||
Reference in New Issue
Block a user