projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3c91484
)
Don't cheat: when only getting several bytes from each source, n is incremented
author
Lutz Jänicke
<jaenicke@openssl.org>
Tue, 9 Jan 2001 10:58:36 +0000
(10:58 +0000)
committer
Lutz Jänicke
<jaenicke@openssl.org>
Tue, 9 Jan 2001 10:58:36 +0000
(10:58 +0000)
correctly, but RAND_add(..,n) counts the increasing n several times.
Only RAND_add(..,n) once entropy collection is finished.
crypto/rand/rand_unix.c
patch
|
blob
|
history
diff --git
a/crypto/rand/rand_unix.c
b/crypto/rand/rand_unix.c
index c4aae38f1d998cb2798de1f4963a176c35f605f9..658d35f81ce428be38d6077123480ee6ceabc4f1 100644
(file)
--- a/
crypto/rand/rand_unix.c
+++ b/
crypto/rand/rand_unix.c
@@
-183,10
+183,13
@@
int RAND_poll(void)
&& t.tv_usec != 0 && n < ENTROPY_NEEDED);
close(fd);
- RAND_add(tmpbuf,sizeof tmpbuf,n);
- memset(tmpbuf,0,n);
}
}
+ if (n > 0)
+ {
+ RAND_add(tmpbuf,sizeof tmpbuf,n);
+ memset(tmpbuf,0,n);
+ }
#endif
/* put in some default random data, we need more than just this */