Skip to content

secure_storage: improve expandability and other minor improvements #90395

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

Merged

Conversation

tomi-font
Copy link
Collaborator

See commits.

Copy link
Collaborator

@valeriosetti valeriosetti left a comment

Choose a reason for hiding this comment

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

I only have some concern with changes to secure_storage_its_transform_aead_get_key, but the rest is OK to me.

@tomi-font tomi-font requested a review from valeriosetti May 26, 2025 06:46
@tomi-font tomi-font force-pushed the secure_storage_expandability branch from 8a3c261 to a1984f4 Compare May 26, 2025 11:31
@tomi-font tomi-font requested review from valeriosetti and removed request for valeriosetti May 26, 2025 11:32
valeriosetti
valeriosetti previously approved these changes May 26, 2025
@tomi-font tomi-font requested a review from kartben May 27, 2025 07:11
LOG_DBG("%s %s. (%d)", ret ? "Failed to delete" : "Deleted", name, ret);
return ret ? PSA_ERROR_STORAGE_FAILURE : PSA_SUCCESS;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could explain a bit what is the purpose here? Why the ret here which is not a psa_status_t is returned as is? Especially since you already log the error before why you want to also propagate it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's already logged here but only if debug logging is enabled.
The purpose here was to also have it logged as an error by the calling function if something goes wrong, as the default is to have debug logs off.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reverted this change and changed the way it's done in zms.c to be aligned and clearer.

endif()
if(CONFIG_SECURE_STORAGE_ITS_TRANSFORM_IMPLEMENTATION_AEAD)

if((NOT CONFIG_SECURE_STORAGE_ITS_TRANSFORM_AEAD_SCHEME_AES_GCM
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks ok overall but it would be nice to have a comment on the top of this if statement to describe a bit the cases that you are trying to cover her e since the if statement is now quite long. Just a high level description would be nice I think.

tomi-font added 4 commits May 27, 2025 15:01
Some minor improvements.

Signed-off-by: Tomi Fontanilles <[email protected]>
Instead of checking for CONFIG_SECURE_STORAGE_ITS_TRANSFORM_AEAD_*_CUSTOM,
check for any of the existing providers.
This allows downstream users to expand the choices with more options

Signed-off-by: Tomi Fontanilles <[email protected]>
Some ITS store module implementations may make use of them.
This is the case of the custom one in the
secure_storage.psa.its.secure_storage.custom.store test.

Instead of making transform.h conditionally available, move the definitions
to common.h and simply make them available whenever the ITS transform
module is enabled.

At the same time, remove unneeded/redundant includes/build asserts.

Signed-off-by: Tomi Fontanilles <[email protected]>
Instead of checking whether a custom implementation is present, check
whether the AEAD one is used.
This allows downstream users to expand the implementation choice with
more options.

Signed-off-by: Tomi Fontanilles <[email protected]>
Copy link

@kartben kartben merged commit 18b14e7 into zephyrproject-rtos:main May 27, 2025
26 checks passed
kartben added a commit to kartben/zephyr that referenced this pull request May 27, 2025
Allow users to create links to Kconfig regex searches.
The new role generates links to the Kconfig search page with the regex
pattern as the search query.

Fixes zephyrproject-rtos#90395

Signed-off-by: Benjamin Cabé <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Secure Storage Secure Storage area: Storage Storage subsystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants