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 <stephanos.ioannidis@nordicsemi.no>
This commit is contained in:
Stephanos Ioannidis 2022-12-14 05:30:26 +09:00 committed by Carles Cufí
commit 37c6d52f8c

View file

@ -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()