This code drains /dev/random only on linux, it totally ignores it on other platforms. Let's switch to /dev/urandom instead, which is more reliable and will provide at least as good a result as on non-linux platforms without failing to start. --- ./src/crypto/random.c.dist 2018-03-15 20:46:40.521096059 +0100 +++ ./src/crypto/random.c 2018-03-15 20:48:40.291272666 +0100 @@ -227,13 +227,13 @@ /* * Try to fetch some more data from the kernel high quality - * /dev/random. There may not be enough data available at this point, + * /dev/urandom. There may not be enough data available at this point, * so use non-blocking read to avoid blocking the application * completely. */ - fd = open("/dev/random", O_RDONLY | O_NONBLOCK); + fd = open("/dev/urandom", O_RDONLY | O_NONBLOCK); if (fd < 0) { - wpa_printf(MSG_ERROR, "random: Cannot open /dev/random: %s", + wpa_printf(MSG_ERROR, "random: Cannot open /dev/urandom: %s", strerror(errno)); return -1; } @@ -241,12 +241,12 @@ res = read(fd, dummy_key + dummy_key_avail, sizeof(dummy_key) - dummy_key_avail); if (res < 0) { - wpa_printf(MSG_ERROR, "random: Cannot read from /dev/random: " + wpa_printf(MSG_ERROR, "random: Cannot read from /dev/urandom: " "%s", strerror(errno)); res = 0; } wpa_printf(MSG_DEBUG, "random: Got %u/%u bytes from " - "/dev/random", (unsigned) res, + "/dev/urandom", (unsigned) res, (unsigned) (sizeof(dummy_key) - dummy_key_avail)); dummy_key_avail += res; close(fd); @@ -259,7 +259,7 @@ } wpa_printf(MSG_INFO, "random: Only %u/%u bytes of strong " - "random data available from /dev/random", + "random data available from /dev/urandom", (unsigned) dummy_key_avail, (unsigned) sizeof(dummy_key)); if (own_pool_ready >= MIN_READY_MARK || @@ -312,12 +312,12 @@ res = read(sock, dummy_key + dummy_key_avail, sizeof(dummy_key) - dummy_key_avail); if (res < 0) { - wpa_printf(MSG_ERROR, "random: Cannot read from /dev/random: " + wpa_printf(MSG_ERROR, "random: Cannot read from /dev/urandom: " "%s", strerror(errno)); return; } - wpa_printf(MSG_DEBUG, "random: Got %u/%u bytes from /dev/random", + wpa_printf(MSG_DEBUG, "random: Got %u/%u bytes from /dev/urandom", (unsigned) res, (unsigned) (sizeof(dummy_key) - dummy_key_avail)); dummy_key_avail += res; @@ -412,14 +412,14 @@ if (random_fd >= 0) return; - random_fd = open("/dev/random", O_RDONLY | O_NONBLOCK); + random_fd = open("/dev/urandom", O_RDONLY | O_NONBLOCK); if (random_fd < 0) { - wpa_printf(MSG_ERROR, "random: Cannot open /dev/random: %s", + wpa_printf(MSG_ERROR, "random: Cannot open /dev/urandom: %s", strerror(errno)); return; } wpa_printf(MSG_DEBUG, "random: Trying to read entropy from " - "/dev/random"); + "/dev/urandom"); eloop_register_read_sock(random_fd, random_read_fd, NULL, NULL); #endif /* __linux__ */