Mercurial > dropbear
comparison random.c @ 835:4095b6d7c9fc ecc
Merge in changes from the past couple of releases
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 18 Oct 2013 21:38:01 +0800 |
parents | 7dcb46da72d9 5de524aec047 |
children | 3a9ec98808c3 |
comparison
equal
deleted
inserted
replaced
807:75509065db53 | 835:4095b6d7c9fc |
---|---|
76 | 76 |
77 readcount = 0; | 77 readcount = 0; |
78 while (len == 0 || readcount < len) | 78 while (len == 0 || readcount < len) |
79 { | 79 { |
80 int readlen, wantread; | 80 int readlen, wantread; |
81 unsigned char readbuf[2048]; | 81 unsigned char readbuf[4096]; |
82 if (!already_blocked) | 82 if (!already_blocked) |
83 { | 83 { |
84 int ret; | 84 int ret; |
85 struct timeval timeout = { .tv_sec = 2, .tv_usec = 0}; | 85 struct timeval timeout = { .tv_sec = 2, .tv_usec = 0}; |
86 fd_set read_fds; | 86 fd_set read_fds; |
207 process_file(&hs, "/proc/interrupts", 0, 0); | 207 process_file(&hs, "/proc/interrupts", 0, 0); |
208 | 208 |
209 process_file(&hs, "/proc/loadavg", 0, 0); | 209 process_file(&hs, "/proc/loadavg", 0, 0); |
210 process_file(&hs, "/proc/sys/kernel/random/entropy_avail", 0, 0); | 210 process_file(&hs, "/proc/sys/kernel/random/entropy_avail", 0, 0); |
211 | 211 |
212 /* Mostly network visible but useful in some situations */ | 212 /* Mostly network visible but useful in some situations. |
213 process_file(&hs, "/proc/net/netstat", 0, 0); | 213 * Limit size to avoid slowdowns on systems with lots of routes */ |
214 process_file(&hs, "/proc/net/dev", 0, 0); | 214 process_file(&hs, "/proc/net/netstat", 4096, 0); |
215 process_file(&hs, "/proc/net/tcp", 0, 0); | 215 process_file(&hs, "/proc/net/dev", 4096, 0); |
216 process_file(&hs, "/proc/net/tcp", 4096, 0); | |
216 /* Also includes interface lo */ | 217 /* Also includes interface lo */ |
217 process_file(&hs, "/proc/net/rt_cache", 0, 0); | 218 process_file(&hs, "/proc/net/rt_cache", 4096, 0); |
218 process_file(&hs, "/proc/vmstat", 0, 0); | 219 process_file(&hs, "/proc/vmstat", 0, 0); |
219 #endif | 220 #endif |
220 | 221 |
221 pid = getpid(); | 222 pid = getpid(); |
222 sha1_process(&hs, (void*)&pid, sizeof(pid)); | 223 sha1_process(&hs, (void*)&pid, sizeof(pid)); |