comparison random.c @ 688:650c41a4909a

Add a few more files in /proc for Linux
author Matt Johnston <matt@ucc.asn.au>
date Sat, 30 Jun 2012 22:12:28 +0800
parents 167fdc091c05
children c3de235d9506
comparison
equal deleted inserted replaced
687:167fdc091c05 688:650c41a4909a
203 } 203 }
204 #endif 204 #endif
205 205
206 /* A few other sources to fall back on. Add more here for other platforms */ 206 /* A few other sources to fall back on. Add more here for other platforms */
207 #ifdef __linux__ 207 #ifdef __linux__
208 /* Seems to be a reasonable source of entropy from timers */ 208 /* Seems to be a reasonable source of entropy from timers. Possibly hard
209 * for even local attackers to reproduce */
209 process_file(&hs, "/proc/timer_list", 0, 0); 210 process_file(&hs, "/proc/timer_list", 0, 0);
210 /* Might help on systems with wireless */ 211 /* Might help on systems with wireless */
211 process_file(&hs, "/proc/interrupts", 0, 0); 212 process_file(&hs, "/proc/interrupts", 0, 0);
213
214 /* Mostly network visible but useful in some situations */
215 process_file(&hs, "/proc/net/netstat", 0, 0);
216 process_file(&hs, "/proc/net/dev", 0, 0);
217 process_file(&hs, "/proc/net/tcp", 0, 0);
218 /* Also includes interface lo */
219 process_file(&hs, "/proc/net/rt_cache", 0, 0);
212 #endif 220 #endif
213 221
214 pid = getpid(); 222 pid = getpid();
215 sha1_process(&hs, (void*)&pid, sizeof(pid)); 223 sha1_process(&hs, (void*)&pid, sizeof(pid));
216 224