summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2012-06-30 22:12:28 +0800
committerMatt Johnston <matt@ucc.asn.au>2012-06-30 22:12:28 +0800
commit6ba2b2b3845e49564ca5129ab335a414f50f0149 (patch)
tree17499f5ab8fc210a0b98b58166859cf808a3181a
parentd5ccc32b4d8903562107a534fbe09433c27d2880 (diff)
Add a few more files in /proc for Linux
-rw-r--r--random.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/random.c b/random.c
index 2cf5c74..f729ae2 100644
--- a/random.c
+++ b/random.c
@@ -205,10 +205,18 @@ void seedrandom() {
/* A few other sources to fall back on. Add more here for other platforms */
#ifdef __linux__
- /* Seems to be a reasonable source of entropy from timers */
+ /* Seems to be a reasonable source of entropy from timers. Possibly hard
+ * for even local attackers to reproduce */
process_file(&hs, "/proc/timer_list", 0, 0);
/* Might help on systems with wireless */
process_file(&hs, "/proc/interrupts", 0, 0);
+
+ /* Mostly network visible but useful in some situations */
+ process_file(&hs, "/proc/net/netstat", 0, 0);
+ process_file(&hs, "/proc/net/dev", 0, 0);
+ process_file(&hs, "/proc/net/tcp", 0, 0);
+ /* Also includes interface lo */
+ process_file(&hs, "/proc/net/rt_cache", 0, 0);
#endif
pid = getpid();