Skip to content

Commit 4ea6739

Browse files
committed
[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 <alberto.escolar.piedras@nordicsemi.no> Upstream PR #: 723
1 parent 9deb104 commit 4ea6739

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

core/psa_crypto.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6958,7 +6958,9 @@ static int psa_key_derivation_allows_free_form_secret_input(
69586958
psa_status_t psa_key_derivation_setup(psa_key_derivation_operation_t *operation,
69596959
psa_algorithm_t alg)
69606960
{
6961+
#if defined(AT_LEAST_ONE_BUILTIN_KDF)
69616962
psa_status_t status;
6963+
#endif
69626964

69636965
if (operation->alg != 0) {
69646966
return PSA_ERROR_BAD_STATE;
@@ -6991,10 +6993,12 @@ psa_status_t psa_key_derivation_setup(psa_key_derivation_operation_t *operation,
69916993
return PSA_ERROR_INVALID_ARGUMENT;
69926994
}
69936995

6996+
#if defined(AT_LEAST_ONE_BUILTIN_KDF)
69946997
if (status == PSA_SUCCESS) {
69956998
operation->alg = alg;
69966999
}
69977000
return status;
7001+
#endif /* AT_LEAST_ONE_BUILTIN_KDF */
69987002
}
69997003

70007004
#if defined(BUILTIN_ALG_ANY_HKDF)

0 commit comments

Comments
 (0)