Skip to content

Commit

Permalink
nrf_security: Fix kconfig extension macro inconsistent configuration
Browse files Browse the repository at this point in the history
Fix the kconfig_check_and_set_base_to_val_depends extension macro
creating an inconsistent configuration.
This macro sets the base name to, but not the kconfig name.
For example:
'kconfig_check_and_set_base_to_val_depends(MBEDTLS_EXAMPLE_ALG,
PSA_WANT_EXAMPLE_ALG)' can create this inconsistentency:
CONFIG_PSA_WANT_EXAMPLE_ALG: true
MBEDTLS_EXAMPLE_ALG: true
CONFIG_MBEDTLS_EXAMPLE_ALG: false

This means that the macro cannot be used to check a series of chained
dependencies.

Make sure that the macro modifies the value of both the base and the
kconfig variable.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
  • Loading branch information
joerchan authored and carlescufi committed Jun 23, 2023
1 parent 12f1b8a commit e954ddb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions subsys/nrf_security/cmake/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ macro(kconfig_check_and_set_base_to_val_depends base val)
if(_argn_all_true)
nrf_security_debug("Setting ${base} to True because all depends are set")
set(${base} ${val})
set(CONFIG_${base} ${val})
else()
nrf_security_debug("Not setting ${base} because ${_argn_false_arg} is not set")
endif()
Expand Down

0 comments on commit e954ddb

Please sign in to comment.