Skip to content

Commit f96148d

Browse files
seko-nordicrlubos
authored andcommitted
Revert "nrf_security: Enable NRF_RNG_ENTROPY_DRIVER for fake entropy"
This reverts commit ed84479. Signed-off-by: Sergey Korotkov <[email protected]>
1 parent c20a03d commit f96148d

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

subsys/nrf_security/src/drivers/zephyr/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ config PSA_NEED_NRF_RNG_ENTROPY_DRIVER
1010
# Cannot select entropy-generator without creating a loop to ENTROPY_PSA_CRYPTO_RNG
1111
depends on ENTROPY_GENERATOR
1212
select PSA_ACCEL_GET_ENTROPY
13-
depends on HAS_HW_NRF_RNG || FAKE_ENTROPY_NRF_PRNG
13+
depends on HAS_HW_NRF_RNG
1414
depends on (!PSA_USE_CC3XX_CTR_DRBG_DRIVER && !PSA_USE_CC3XX_HMAC_DRBG_DRIVER) && \
1515
(PSA_USE_CTR_DRBG_DRIVER || PSA_USE_HMAC_DRBG_DRIVER)

subsys/nrf_security/src/drivers/zephyr/nrf_rng_entropy.c

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,19 @@
1717
* It uses a "Zephyr entropy driver" and can therefore only be used in
1818
* Zephyr images.
1919
*
20-
* This is used for two uses cases, the first use case is when hardware
21-
* crypto/entropy is not yet supported. This enables running software crypto
22-
* with a non cryptographically secure random generator to unblock development
23-
* when the device tree node with the DT label 'prng' is enabled.
20+
* Note that it is only the device driver with the DT label 'rng' that
21+
* is supported and that this rng label is only applied for the Zephyr
22+
* driver that uses the HW peripheral NRF_RNG (entropy_nrf5.c).
2423
*
25-
* The second use case is for instance nrf52820 which has an NRF_RNG
24+
* An intended use-case is for instance nrf52820 which has an NRF_RNG
2625
* peripheral, but does not have a HW crypto trng like cryptocell.
27-
* In this use case the device driver with the DT label 'rng'
28-
* is supported and this rng label is only applied for the Zephyr
29-
* driver that uses the HW peripheral NRF_RNG (entropy_nrf5.c).
3026
*
3127
* Note that NRF_RNG produces TRNG, not CSPRNG.
3228
*/
33-
#ifdef CONFIG_FAKE_ENTROPY_NRF_PRNG
34-
#define DTS_RNG_NODE_LABEL prng
35-
#else
36-
#define DTS_RNG_NODE_LABEL rng
37-
#endif
38-
3929
psa_status_t nrf_rng_get_entropy(uint32_t flags, size_t *estimate_bits, uint8_t *output,
4030
size_t output_size)
4131
{
42-
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(DTS_RNG_NODE_LABEL));
32+
const struct device *dev = DEVICE_DT_GET(DT_NODELABEL(rng));
4333
uint16_t request_len = MIN(UINT16_MAX, output_size);
4434
int err;
4535

0 commit comments

Comments
 (0)