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

Bluetooth: Mesh: use secure storage in ble mesh #82319

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alxelax
Copy link
Collaborator

@alxelax alxelax commented Nov 29, 2024

PR:

  • adds dependency of the mbedtls psa usage on secure storage
  • removes PSA ITS emulator and enables usage of
    the secure storage in ble mesh bsim tests
  • enables secure storage in all ble mesh and related samples

Copy link
Collaborator

@tomi-font tomi-font left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might also be worth a migration guide entry to indicate that it's now necessary to select the affected Kconfig options for the secure storage subsystem.

subsys/secure_storage/Kconfig.its_store Outdated Show resolved Hide resolved
subsys/secure_storage/Kconfig Outdated Show resolved Hide resolved
subsys/secure_storage/Kconfig.its_store Outdated Show resolved Hide resolved
@alxelax alxelax force-pushed the remove_psa_its_emulator branch from 63bf345 to 8321d0b Compare December 3, 2024 10:51
@zephyrbot zephyrbot added the area: Samples Samples label Dec 3, 2024
@zephyrbot zephyrbot requested review from kartben and nashif December 3, 2024 10:52
@alxelax alxelax force-pushed the remove_psa_its_emulator branch from 8321d0b to 1bb8e85 Compare December 3, 2024 11:30
@zephyrbot zephyrbot added the Release Notes To be mentioned in the release notes label Dec 3, 2024
@alxelax alxelax force-pushed the remove_psa_its_emulator branch from 1bb8e85 to a1685a0 Compare December 3, 2024 11:46
samples/psa/its/overlay-secure_storage.conf Outdated Show resolved Hide resolved
subsys/secure_storage/Kconfig.its_store Outdated Show resolved Hide resolved
doc/releases/migration-guide-4.1.rst Outdated Show resolved Hide resolved
doc/releases/migration-guide-4.1.rst Outdated Show resolved Hide resolved
doc/releases/migration-guide-4.1.rst Outdated Show resolved Hide resolved
doc/releases/migration-guide-4.1.rst Outdated Show resolved Hide resolved
doc/releases/release-notes-4.1.rst Outdated Show resolved Hide resolved
@alxelax alxelax force-pushed the remove_psa_its_emulator branch from a1685a0 to e3ee4e9 Compare December 3, 2024 15:07
@sjanc
Copy link
Collaborator

sjanc commented Dec 6, 2024

#AutoPTS run zephyr nrf52 MESH/NODE/KR/BV-01-C DFUM/SR/FD/BV-01-C

@codecoup-tester
Copy link

Scheduled PR #82319 (comment), board: nrf52, estimated start time: 14:43:31, test case count: 2, estimated duration: 0:04:49

Test cases to be runDFUM/SR/FD/BV-01-C
MESH/NODE/KR/BV-01-C

@codecoup-tester
Copy link

AutoPTS Bot results:

Failed tests (1)MESH MESH/NODE/KR/BV-01-C FAIL
Successful tests (1)DFUM DFUM/SR/FD/BV-01-C PASS

@alxelax alxelax force-pushed the remove_psa_its_emulator branch 2 times, most recently from 0a9a26d to 08377ea Compare January 2, 2025 12:53
@alxelax
Copy link
Collaborator Author

alxelax commented Jan 2, 2025

Hi @tomi-font, seems yml files those are used to check secure storage samples and tests use twister filter feature that doesn't work properly.
Dependencies those were initially added (and later changed to even more strict dependencies) do not prevent building tests and samples for platforms without FLASH.
You can take a look, almost all twister CI steps cannot pass.

Since I'm not an expert in secure storage, I'd like to get any ideas how to solve this issue.
My suggestion is to use list of allowed platforms instead of filters.

@tomi-font
Copy link
Collaborator

@alxelax It rather looks like the problems are caused by the changes in your PR. Failures in this PR pass locally on main. Also for instance a recent fixup PR had green CI.
Right now I don't have the bandwidth to look into fixing this myself, but I suggest you the following:

  • Rebase your PR on the latest main.
  • Don't, for instance, change the not CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION_NONE part of the filter by CONFIG_FLASH_HAS_DRIVER_ENABLED as you currently do in the samples' YAML files. It will for sure provoke failures. CONFIG_SECURE_STORAGE_ITS_STORE_IMPLEMENTATION has more complex filtering than just FLASH_HAS_DRIVER_ENABLED because I found out that just this Kconfig option wasn't enough (thus the check for DT properties).
  • secure_storage.psa.its.secure_storage.custom.store doesn't require flash as the custom store implementation is RAM-based. Same applies to secure_storage.psa.its.secure_storage.custom.both.
  • I'm pretty sure you don't want to use FLASH_HAS_DRIVER_ENABLED at all in the filters. You want to use the Kconfig option that corresponds to the ITS store module implementation that is expected to be used (ZMS or settings or just "not none"). The filtering is handled in those Kconfig options.

@alxelax alxelax force-pushed the remove_psa_its_emulator branch from 08377ea to bfb5e24 Compare January 9, 2025 08:06
@alxelax
Copy link
Collaborator Author

alxelax commented Jan 9, 2025

@tomi-font, I removed my changes from filters, but you can see they still do not work. Twister runs Secure storage tests on platforms without Flash (it was the initial reason why I added direct dependency on Flash driver presence). Those obviously are not built.
It seems to me like filters do not work properly.
Any ideas?

@alxelax alxelax force-pushed the remove_psa_its_emulator branch from bfb5e24 to ef4654f Compare January 9, 2025 09:24
@alxelax
Copy link
Collaborator Author

alxelax commented Jan 9, 2025

@tomi-font, I removed NVS and FLASH dependency for sample tests. Seems filters do not work. Now it passes for all platforms those sneak over filters. Really do not want to fix secure storage test system.

@alxelax alxelax requested a review from tomi-font January 9, 2025 11:25
@alxelax alxelax force-pushed the remove_psa_its_emulator branch 2 times, most recently from f7e4a37 to 88ff6d3 Compare January 9, 2025 15:01
@zephyrbot zephyrbot added the platform: nRF Nordic nRFx label Jan 9, 2025
@alxelax alxelax dismissed tomi-font’s stale review January 9, 2025 15:03

Just gave up to adapt secure storage tests and made changes only in mesh related code with depends on SECURE_STORAGE

@alxelax alxelax removed Release Notes To be mentioned in the release notes area: Secure Storage Secure Storage labels Jan 9, 2025
@alxelax alxelax requested a review from Balaklaka January 9, 2025 15:04
@HaavardRei
Copy link
Contributor

HaavardRei commented Jan 10, 2025

The commit title says "use psa crypto storage in mesh bsim", but you change files in modules/, samples/, subsys/.../Kconfig and tests/. Maybe this can be split into three? (Modules, samples/Kconfig and bsim, or something like this)

@alxelax
Copy link
Collaborator Author

alxelax commented Jan 10, 2025

The commit title says "use psa crypto storage in mesh bsim", but you change files in modules/, samples/, subsys/.../Kconfig and tests/. Maybe this can be split into three? (Modules, samples/Kconfig and bsim, or something like this)

Almost all changes are related. It is not possible to remove its emulator and start using secure storage directly without changes in modules/, subsys/ and tests/. It is possible to tract changes in samples/ as more or less independent. However, I do not see big advantages to split it as separate commit since they do not have sense without changes in subsys/.../Kconfig.

I will add more description details in commit message for better understanding.

Commit:
 - adds dependency of the mbedtls psa usage on secure storage
 - removes PSA ITS emulator and enables usage of
   the secure storage in ble mesh bsim tests
 - enables secure storage in all ble mesh and related samples

Signed-off-by: Aleksandr Khromykh <[email protected]>
@alxelax alxelax force-pushed the remove_psa_its_emulator branch from 88ff6d3 to 29a3bf5 Compare January 10, 2025 12:55
@alxelax alxelax changed the title tests: Bluetooth: Mesh: use psa secure storage in mesh bsim tests Bluetooth: Mesh: use secure storage in ble mesh Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants