mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
See ChangeLog: Wed Jan 20 18:59:49 CET 1999 Werner Koch
This commit is contained in:
parent
ce650acf1f
commit
7debff3867
15 changed files with 321 additions and 63 deletions
|
@ -1,3 +1,7 @@
|
|||
Wed Jan 20 18:59:49 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* rndunix.c (gather_random): Fix to avoid infinite loop.
|
||||
|
||||
Sun Jan 17 11:04:33 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* des.c (is_weak_key): Replace system memcmp due to bugs
|
||||
|
|
|
@ -709,6 +709,7 @@ gather_random( void (*add)(const void*, size_t, int), int requester,
|
|||
/* now read from the gatherer */
|
||||
while( length ) {
|
||||
int goodness;
|
||||
ulong subtract;
|
||||
|
||||
if( read_a_msg( pipedes[0], &msg ) ) {
|
||||
g10_log_error("reading from gatherer pipe failed: %s\n",
|
||||
|
@ -742,7 +743,9 @@ gather_random( void (*add)(const void*, size_t, int), int requester,
|
|||
(*add)( msg.data, n, requester );
|
||||
|
||||
/* this is the trick how e cope with the goodness */
|
||||
length -= (ulong)n * goodness / 100;
|
||||
subtract = (ulong)n * goodness / 100;
|
||||
/* subtract at least 1 byte to avoid infinite loops */
|
||||
length -= subtract ? subtract : 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue