summaryrefslogtreecommitdiff
path: root/package/hostapd/patches/700-use_dev_urandom.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-24 18:54:20 +0000
committerFelix Fietkau <nbd@openwrt.org>2011-01-24 18:54:20 +0000
commit0e6529d50cd7fb356c4d9d26f076d787f3f74c7c (patch)
tree91ea8a45c58b704a95e5f4c1f498d9b64bfac24f /package/hostapd/patches/700-use_dev_urandom.patch
parent9b34dfb5715cceeddb974751bf60c4766cbf700b (diff)
downloadmtk-20170518-0e6529d50cd7fb356c4d9d26f076d787f3f74c7c.zip
mtk-20170518-0e6529d50cd7fb356c4d9d26f076d787f3f74c7c.tar.gz
mtk-20170518-0e6529d50cd7fb356c4d9d26f076d787f3f74c7c.tar.bz2
hostapd: update to 20110117
SVN-Revision: 25094
Diffstat (limited to 'package/hostapd/patches/700-use_dev_urandom.patch')
-rw-r--r--package/hostapd/patches/700-use_dev_urandom.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/package/hostapd/patches/700-use_dev_urandom.patch b/package/hostapd/patches/700-use_dev_urandom.patch
new file mode 100644
index 0000000..b72319f
--- /dev/null
+++ b/package/hostapd/patches/700-use_dev_urandom.patch
@@ -0,0 +1,47 @@
+--- a/src/crypto/random.c
++++ b/src/crypto/random.c
+@@ -202,16 +202,16 @@ int random_pool_ready(void)
+
+ /*
+ * 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) {
+ #ifndef CONFIG_NO_STDOUT_DEBUG
+ int error = errno;
+- perror("open(/dev/random)");
+- wpa_printf(MSG_ERROR, "random: Cannot open /dev/random: %s",
++ perror("open(/dev/urandom)");
++ wpa_printf(MSG_ERROR, "random: Cannot open /dev/urandom: %s",
+ strerror(error));
+ #endif /* CONFIG_NO_STDOUT_DEBUG */
+ return -1;
+@@ -220,12 +220,12 @@ int random_pool_ready(void)
+ 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);
+@@ -234,7 +234,7 @@ int random_pool_ready(void)
+ return 1;
+
+ 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 ||