diff --git a/src/utils/os_zephyr.c b/src/utils/os_zephyr.c index b1f733d0a..ad65ac4dd 100644 --- a/src/utils/os_zephyr.c +++ b/src/utils/os_zephyr.c @@ -144,9 +144,13 @@ void os_daemonize_terminate(const char *pid_file) int os_get_random(unsigned char *buf, size_t len) { +#if defined(CONFIG_ENTROPY_HAS_DRIVER) + return sys_csrand_get(buf, len); +#else sys_rand_get(buf, len); return 0; +#endif } unsigned long os_random(void)