~mdw
/
sgt
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add proper error reports in write_random_seed, via the new 'nonfatal'
[sgt/putty]
/
sshrand.c
diff --git
a/sshrand.c
b/sshrand.c
index
b728fd9
..
85dfa0b
100644
(file)
--- a/
sshrand.c
+++ b/
sshrand.c
@@
-199,9
+199,9
@@
static void random_add_heavynoise_bitbybit(void *noise, int length)
pool.poolpos = i;
}
pool.poolpos = i;
}
-static void random_timer(void *ctx, long now)
+static void random_timer(void *ctx,
unsigned
long now)
{
{
- if (random_active > 0 && now
- next_noise_collection >= 0
) {
+ if (random_active > 0 && now
== next_noise_collection
) {
noise_regular();
next_noise_collection =
schedule_timer(NOISE_REGULAR_INTERVAL, random_timer, &pool);
noise_regular();
next_noise_collection =
schedule_timer(NOISE_REGULAR_INTERVAL, random_timer, &pool);
@@
-234,6
+234,8
@@
void random_unref(void)
int random_byte(void)
{
int random_byte(void)
{
+ assert(random_active);
+
if (pool.poolpos >= POOLSIZE)
random_stir();
if (pool.poolpos >= POOLSIZE)
random_stir();