Repository navigation
boot: zephyr: Fix RNG/entropy being enabled by default - #2939
Conversation
| config MBEDTLS_ENTROPY_C | ||
| default n | ||
|
|
||
| config MBEDTLS_HMAC_DRBG_C | ||
| default n | ||
|
|
||
| config TEST_RANDOM_GENERATOR | ||
| default n |
There was a problem hiding this comment.
These defaults should not be required. I tried to build with and without them and I get the same results in terms of footprint on the nrf52840dk.
Please double-check on your end, but if confirmed I would drop them.
There was a problem hiding this comment.
Reworked it, was missing that the test entropy source was being selected by default anyway and causing a Kconfig warning about an insecure Kconfig being selected, so fixed that, kept these because they are not needed in this mode
| endif # BOOT_USE_PSA_CRYPTO | ||
|
|
||
| # In the default mode, MCUboot uses PSA crypto for generating hashes and check signature validity, | ||
| # it does not need an entropy source as it is not generating signatures. Therefore default to |
There was a problem hiding this comment.
I would either complete the sentence to match all the limitations related to the removal of entropy source, like this:
it does not need an entropy source as it is not generating signatures, decrypting images or using randomized instructions timing for hardening.
or just drop the final part of the sentence:
so it does not need an entropy source.
Wdyt?
That's minor though, so feel free to ignore if you deem this not to be relevant.
Fixes an issue whereby RNG/entropy in PSA crypto is enabled by default, this is not needed and just serves to slow down boot times and increase the output image size. It is only needed when FIH high mode is enabled, or when encryption is enabled, therefore leave it enabled in those modes. Users are free to override this from out of tree, if their specific crypto engines need it. This also fixes an issue whereby a Kconfig warning was emitted stating that a non-secure Kconfig was enabled, despite not actually being needed or used (unless encryption/FIH high is selected without a true entropy source, in which case it will still be emitted, validly) Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Fixes an issue whereby RNG/entropy in PSA crypto is enabled by default, this is not needed and just serves to slow down boot times and increase the output image size. It is only needed when FIH high mode is enabled, or when encryption is enabled, therefore leave it enabled in those modes. Users are free to override this from out of tree, if their specific crypto engines need it
This also fixes an issue whereby a Kconfig warning was emitted stating that a non-secure Kconfig was enabled, despite not actually being needed or used (unless encryption/FIH high is selected without a true entropy source, in which case it will still be emitted, validly)
@valeriosetti