Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secure_storage: fix Kconfig dependencies #86181

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/releases/migration-guide-4.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,15 @@ LoRa
additional ``user_data`` parameter, which is a void pointer. This parameter can be used to reference
any user-defined data structure. To maintain the current behavior, set this parameter to ``NULL``.

Secure Storage
==============

* Store backends no longer automatically enable their dependencies through ``select`` or ``imply``.
Users must ensure that the depencies are enabled in their applications.
:kconfig:option:`CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS` previously enabled NVS
and settings, which means the NVS settings backend would get used by default if ZMS wasn't
enabled. (:github:`86181`)

Stream Flash
============

Expand Down
6 changes: 6 additions & 0 deletions samples/psa/its/overlay-secure_storage.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MAIN_STACK_SIZE=3072

CONFIG_SECURE_STORAGE=y
CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y
CONFIG_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
6 changes: 6 additions & 0 deletions samples/psa/persistent_key/overlay-secure_storage.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MAIN_STACK_SIZE=3072

CONFIG_SECURE_STORAGE=y
CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y
CONFIG_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
2 changes: 1 addition & 1 deletion subsys/fs/nvs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
config NVS
bool "Non-volatile Storage"
depends on FLASH
depends on FLASH_PAGE_LAYOUT
select CRC
select FLASH_PAGE_LAYOUT
help
Enable support of Non-volatile Storage.

Expand Down
1 change: 0 additions & 1 deletion subsys/secure_storage/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ endif

menuconfig SECURE_STORAGE_ITS_STORE_MODULE
bool "ITS store module"
imply FLASH # for FLASH_HAS_DRIVER_ENABLED
help
The module that handles the storage/retrieval of the ITS data to/from NVM.
Zephyr's ITS implementation calls into it.
Expand Down
6 changes: 2 additions & 4 deletions subsys/secure_storage/Kconfig.its_store
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS
depends on FLASH_HAS_DRIVER_ENABLED \
&& $(dt_path_enabled,$(DT_ITS_PARTITION)) \
&& $(dt_node_has_compat,$(dt_node_parent,$(DT_ITS_PARTITION)),fixed-partitions)
select ZMS
depends on ZMS
help
This implementation of the ITS store module makes direct use of ZMS for storage.
It needs a `secure_storage_its_partition` devicetree chosen property that points
Expand All @@ -31,9 +31,7 @@ config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS
&& $(dt_node_has_compat,$(dt_node_parent,$(DT_SETTINGS_PARTITIION)),fixed-partitions))\
|| ($(dt_path_enabled,$(DT_STORAGE_PARTITION)) \
&& $(dt_node_has_compat,$(dt_node_parent,$(DT_STORAGE_PARTITION)),fixed-partitions)))
imply FLASH_MAP
imply NVS
select SETTINGS
depends on SETTINGS

config SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_NONE
bool "No ITS store module implementation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_SECURE_STORAGE=y
# For testing isolation between the different callers of the ITS.
CONFIG_SECURE_STORAGE_PS_IMPLEMENTATION_ITS=y
CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y
CONFIG_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS=y
CONFIG_SETTINGS=y
CONFIG_SETTINGS_NVS=y
CONFIG_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y

# 256 - flags (1) - CONFIG_SECURE_STORAGE_ITS_TRANSFORM_OUTPUT_OVERHEAD (28)
CONFIG_SECURE_STORAGE_ITS_MAX_DATA_SIZE=227
Expand Down
3 changes: 3 additions & 0 deletions tests/subsys/secure_storage/psa/its/overlay-store_zms.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_ZMS=y
CONFIG_ZMS=y
CONFIG_FLASH=y
6 changes: 3 additions & 3 deletions tests/subsys/secure_storage/psa/its/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ tests:
- nrf9161dk/nrf9161
extra_args:
- EXTRA_DTC_OVERLAY_FILE=zms.overlay
- EXTRA_CONF_FILE=overlay-secure_storage.conf;overlay-transform_default.conf
- EXTRA_CONF_FILE=overlay-secure_storage.conf;overlay-store_zms.conf;overlay-transform_default.conf

secure_storage.psa.its.secure_storage.store.settings:
filter: CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_SETTINGS
extra_args: "EXTRA_CONF_FILE=\
overlay-secure_storage.conf;overlay-transform_default.conf;overlay-store_default.conf"
overlay-secure_storage.conf;overlay-transform_default.conf;overlay-store_settings.conf"

secure_storage.psa.its.secure_storage.custom.transform:
filter: CONFIG_SECURE_STORAGE and not CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_NONE
extra_args: "EXTRA_CONF_FILE=\
overlay-secure_storage.conf;overlay-transform_custom.conf;overlay-store_default.conf"
overlay-secure_storage.conf;overlay-transform_custom.conf;overlay-store_settings.conf"

secure_storage.psa.its.secure_storage.custom.store:
filter: CONFIG_SECURE_STORAGE
Expand Down
Loading