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

tests: secure_storage: psa: enable malloc arena for Mbed TLS #82099

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

tagunil
Copy link
Collaborator

@tagunil tagunil commented Nov 27, 2024

The PSA Crypto implementation provided by Mbed TLS generally requires some amount of heap to function, so enable the arena unconditionally to make the test compatible with MINIMAL_LIBC configurations where the arena is disabled by default.

@@ -6,6 +6,8 @@ CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_TIMER_RANDOM_GENERATOR=y
CONFIG_MBEDTLS_PSA_CRYPTO_C=y

CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=-1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you put that as part of the CONFIG_MBEDTLS_PSA_CRYPTO_C block? Its requirements (e.g. CONFIG_*_RANDOM_GENERATOR) are above it.

Also, this will cause a (non-fatal) warning on board targets without CONFIG_COMMON_LIBC_MALLOC/CONFIG_MINIMAL_LIBC, which is fine, but can you add a small comment explaining what this is for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you mean adding the comment to the conf file itself? Sure, I'll do that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes. Would make it easier for users to get the explanation, as it can show up as a warning in the build.

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.

Also, in your commit message:

The PSA Crypto implementation

🙂

tomi-font
tomi-font previously approved these changes Nov 27, 2024
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.

Thanks! The compliance error is caused by some CI issue which should disappear once you rebase your PR onto the latest main.

The PSA Crypto implementation provided by Mbed TLS generally requires
some amount of heap to function, so enable the arena unconditionally
to make the test compatible with MINIMAL_LIBC configurations where the
arena is disabled by default.

Signed-off-by: Ilya Tagunov <[email protected]>
@tagunil
Copy link
Collaborator Author

tagunil commented Nov 28, 2024

I've limited the size of the arena to fix qemu test failures.

@carlescufi carlescufi merged commit 065bd32 into zephyrproject-rtos:main Nov 29, 2024
18 checks passed
@tagunil tagunil deleted the psa-enable-arena branch November 29, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Secure Storage Secure Storage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants