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

Allow to seed software RNG without STM32 RNG peripheral #7048

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

tbourgoi
Copy link
Contributor

In case the node RNG is disabled in the device tree and we have compiled the driver stm32_rng.c, the function plat_rng_init() will try to read a random value from the RNG peripheral to seed the PRNG of OP-TEE but the peripheral is not initialized.
As a fallback, we could use the default implementation of plat_rng_init() to seed PRNG.

This pull request aims to rename the default implementation of plat_rng_init() to __plat_rng_init().
The second patch update the stm32_rng driver to fallback to __plat_rng_init() if the RNG peripheral is disabled in the DT.

Copy link
Contributor

@jenswi-linaro jenswi-linaro left a comment

Choose a reason for hiding this comment

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

Acked-by: Jens Wiklander <[email protected]>

@jforissier
Copy link
Contributor

Acked-by: Jerome Forissier <[email protected]>

@tbourgoi
Copy link
Contributor Author

both tag applied on the 2 commits

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

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

Reviewed-by: Etienne Carriere <[email protected]>

Rename the function plat_rng_init() to __plat_rng_init() and define
plat_rng_init() as a weak alias of __plat_rng_init().
This allow to use the default RNG initialization in the platform
plat_rng_init() function.

Signed-off-by: Thomas Bourgoin <[email protected]>
Acked-by: Jens Wiklander <[email protected]>
Acked-by: Jerome Forissier <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
In case RNG peripheral is not enabled in device tree, fallback to the
default RNG initialization implementation.

Signed-off-by: Thomas Bourgoin <[email protected]>
Acked-by: Jens Wiklander <[email protected]>
Acked-by: Jerome Forissier <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
@tbourgoi
Copy link
Contributor Author

tag applied

@jforissier jforissier merged commit f2fe4f0 into OP-TEE:master Sep 23, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants