From 37c6d52f8ca817cde65e43ce2c44978414eb060a Mon Sep 17 00:00:00 2001 From: Stephanos Ioannidis Date: Wed, 14 Dec 2022 05:30:26 +0900 Subject: [PATCH] random: Fix non-random number generator warning condition The `TEST_RANDOM_GENERATOR` symbol in itself does not imply that a non-random number generator is selected -- that is indicated by the `RNG_GENERATOR_CHOICE` choices, of which only `TIMER_RANDOM_GENERATOR` is a non-random generator. This commit updates the Random subsystem to print the "non-random number generator usage warning" when `TIMER_RANDOM_GENERATOR` is selected, as opposed to when `TEST_RANDOM_GENERATOR` is selected. Signed-off-by: Stephanos Ioannidis --- subsys/random/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/random/CMakeLists.txt b/subsys/random/CMakeLists.txt index f2943b09fea..3bacc9b014f 100644 --- a/subsys/random/CMakeLists.txt +++ b/subsys/random/CMakeLists.txt @@ -7,9 +7,9 @@ zephyr_library() zephyr_library_sources_ifdef(CONFIG_USERSPACE rand32_handlers.c) endif() -if (CONFIG_TEST_RANDOM_GENERATOR) +if (CONFIG_TIMER_RANDOM_GENERATOR) message(WARNING " - Warning: CONFIG_TEST_RANDOM_GENERATOR is not a truly random generator. + Warning: CONFIG_TIMER_RANDOM_GENERATOR is not a truly random generator. This capability is not secure and it is provided for testing purposes only. Use it carefully.") endif()