From 82726a2b2b096cfb5a772b038ec402dfcdb3e879 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Wed, 27 Apr 2022 15:36:25 +0200 Subject: [PATCH] sys/random/kconfig: remove HWRNG default in backend choice For now we match the Makefile.dep default, ignoring if the platform presents a Hardware RNG. --- cpu/esp_common/esp_common.config | 4 ---- sys/random/Kconfig | 6 +++++- tests/ieee802154_hal/app.config.test.native | 5 ----- tests/pkg_c25519/app.config.test | 4 ---- tests/pkg_cifra/app.config.test | 4 ---- tests/pkg_hacl/app.config.test | 4 ---- tests/pkg_libcose/app.config.test | 4 ---- tests/pkg_libhydrogen/app.config.test | 4 ---- tests/pkg_micro-ecc/app.config.test | 4 ---- tests/pkg_monocypher/app.config.test | 4 ---- tests/pkg_qdsa/app.config.test | 4 ---- tests/pkg_tweetnacl/app.config.test | 4 ---- tests/sys_atomic_utils/app.config.test | 1 - tests/sys_atomic_utils_unittests/app.config.test | 2 -- tests/sys_fido2_ctap/app.config.test | 5 ----- 15 files changed, 5 insertions(+), 54 deletions(-) diff --git a/cpu/esp_common/esp_common.config b/cpu/esp_common/esp_common.config index 642e339789..52e78b7c00 100644 --- a/cpu/esp_common/esp_common.config +++ b/cpu/esp_common/esp_common.config @@ -1,8 +1,4 @@ CONFIG_MODULE_RANDOM=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_MODULE_PERIPH_HWRNG=y CONFIG_MODULE_PERIPH_UART=y CONFIG_MODULE_NEWLIB=y diff --git a/sys/random/Kconfig b/sys/random/Kconfig index e076ac161e..2b72b612a7 100644 --- a/sys/random/Kconfig +++ b/sys/random/Kconfig @@ -13,11 +13,15 @@ menuconfig MODULE_RANDOM if MODULE_RANDOM +comment "This platform has a Hardware RNG, consider using it" + depends on HAS_PERIPH_HWRNG && !MODULE_PRNG_HWRNG + choice RANDOM_IMPLEMENTATION bool "PRNG Implementation" depends on TEST_KCONFIG - default MODULE_PRNG_HWRNG if HAS_PERIPH_HWRNG default MODULE_PRNG_MUSL_LCG + # TODO: make HWRNG on platforms where it is available is a better default, but we want to + # match Makefile.dep. Add it back when migration is done. menuconfig MODULE_PRNG_FORTUNA bool "Fortuna" diff --git a/tests/ieee802154_hal/app.config.test.native b/tests/ieee802154_hal/app.config.test.native index e6a59b9e48..3a985adecc 100644 --- a/tests/ieee802154_hal/app.config.test.native +++ b/tests/ieee802154_hal/app.config.test.native @@ -1,6 +1 @@ CONFIG_MODULE_SOCKET_ZEP=y - -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y diff --git a/tests/pkg_c25519/app.config.test b/tests/pkg_c25519/app.config.test index fb796f7749..93903d2b3f 100644 --- a/tests/pkg_c25519/app.config.test +++ b/tests/pkg_c25519/app.config.test @@ -1,7 +1,3 @@ CONFIG_MODULE_EMBUNIT=y CONFIG_MODULE_RANDOM=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_PACKAGE_C25519=y diff --git a/tests/pkg_cifra/app.config.test b/tests/pkg_cifra/app.config.test index 3d204ad437..0aab052b73 100644 --- a/tests/pkg_cifra/app.config.test +++ b/tests/pkg_cifra/app.config.test @@ -1,7 +1,3 @@ CONFIG_MODULE_EMBUNIT=y CONFIG_MODULE_RANDOM=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_PACKAGE_CIFRA=y diff --git a/tests/pkg_hacl/app.config.test b/tests/pkg_hacl/app.config.test index 8173cc15de..3e2534eb1b 100644 --- a/tests/pkg_hacl/app.config.test +++ b/tests/pkg_hacl/app.config.test @@ -1,7 +1,3 @@ CONFIG_MODULE_EMBUNIT=y CONFIG_MODULE_RANDOM=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_PACKAGE_HACL=y diff --git a/tests/pkg_libcose/app.config.test b/tests/pkg_libcose/app.config.test index 611cd1fbd2..721f6057e5 100644 --- a/tests/pkg_libcose/app.config.test +++ b/tests/pkg_libcose/app.config.test @@ -1,10 +1,6 @@ CONFIG_MODULE_EMBUNIT=y CONFIG_MODULE_LIBCOSE_CRYPT_HACL=y CONFIG_MODULE_MEMARRAY=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_MODULE_RANDOM=y CONFIG_PACKAGE_HACL=y CONFIG_PACKAGE_LIBCOSE=y diff --git a/tests/pkg_libhydrogen/app.config.test b/tests/pkg_libhydrogen/app.config.test index 02959d7859..924f3f89b9 100644 --- a/tests/pkg_libhydrogen/app.config.test +++ b/tests/pkg_libhydrogen/app.config.test @@ -1,7 +1,3 @@ CONFIG_MODULE_EMBUNIT=y CONFIG_MODULE_RANDOM=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_PACKAGE_LIBHYDROGEN=y diff --git a/tests/pkg_micro-ecc/app.config.test b/tests/pkg_micro-ecc/app.config.test index fc3aabc0a7..1429fa79d0 100644 --- a/tests/pkg_micro-ecc/app.config.test +++ b/tests/pkg_micro-ecc/app.config.test @@ -1,7 +1,3 @@ CONFIG_MODULE_HASHES=y CONFIG_MODULE_RANDOM=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_PACKAGE_MICRO-ECC=y diff --git a/tests/pkg_monocypher/app.config.test b/tests/pkg_monocypher/app.config.test index 98ccfef5d5..145800c119 100644 --- a/tests/pkg_monocypher/app.config.test +++ b/tests/pkg_monocypher/app.config.test @@ -1,7 +1,3 @@ CONFIG_MODULE_EMBUNIT=y CONFIG_MODULE_RANDOM=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_PACKAGE_MONOCYPHER=y diff --git a/tests/pkg_qdsa/app.config.test b/tests/pkg_qdsa/app.config.test index 7111b984fd..f76f62ad49 100644 --- a/tests/pkg_qdsa/app.config.test +++ b/tests/pkg_qdsa/app.config.test @@ -1,7 +1,3 @@ CONFIG_MODULE_EMBUNIT=y CONFIG_MODULE_RANDOM=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_PACKAGE_QDSA=y diff --git a/tests/pkg_tweetnacl/app.config.test b/tests/pkg_tweetnacl/app.config.test index 0d2d712b13..d81edac65d 100644 --- a/tests/pkg_tweetnacl/app.config.test +++ b/tests/pkg_tweetnacl/app.config.test @@ -1,7 +1,3 @@ CONFIG_MODULE_EMBUNIT=y CONFIG_MODULE_RANDOM=y -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_PACKAGE_TWEETNACL=y diff --git a/tests/sys_atomic_utils/app.config.test b/tests/sys_atomic_utils/app.config.test index dbd2ab7d78..db297e6e84 100644 --- a/tests/sys_atomic_utils/app.config.test +++ b/tests/sys_atomic_utils/app.config.test @@ -4,5 +4,4 @@ CONFIG_MODULE_ATOMIC_UTILS=y CONFIG_MODULE_FMT=y CONFIG_MODULE_SHELL=y CONFIG_MODULE_RANDOM=y -CONFIG_MODULE_PRNG_MUSL_LCG=y CONFIG_ZTIMER_USEC=y diff --git a/tests/sys_atomic_utils_unittests/app.config.test b/tests/sys_atomic_utils_unittests/app.config.test index df8c9e9dde..48a1c91b70 100644 --- a/tests/sys_atomic_utils_unittests/app.config.test +++ b/tests/sys_atomic_utils_unittests/app.config.test @@ -3,5 +3,3 @@ CONFIG_MODULE_EMBUNIT=y CONFIG_MODULE_ATOMIC_UTILS=y CONFIG_MODULE_RANDOM=y -# Force tinymt32 to be selected -CONFIG_MODULE_PRNG_MUSL_LCG=y diff --git a/tests/sys_fido2_ctap/app.config.test b/tests/sys_fido2_ctap/app.config.test index 5d3f10b646..df5e7e4f8d 100644 --- a/tests/sys_fido2_ctap/app.config.test +++ b/tests/sys_fido2_ctap/app.config.test @@ -6,8 +6,3 @@ CONFIG_MODULE_FIDO2_CTAP_TRANSPORT=y CONFIG_MODULE_FIDO2_CTAP_TRANSPORT_HID=y CONFIG_PACKAGE_FIDO2_TESTS=y - -# Should be autoselecting the MODULE_PRNG_HWRNG if possible -# Since the makefile cannot we have to override until end of migration -# Remove when TEST_KCONFIG is complete -CONFIG_MODULE_PRNG_MUSL_LCG=y