mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
When memsetting the entropy pool to 0, the count should be the size in bytes,
not words.
This commit is contained in:
parent
2fdaa940cc
commit
0ef3f4fb41
1 changed files with 5 additions and 4 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: entropy.c,v 1.56 2001/01/23 03:07:15 marka Exp $ */
|
||||
/* $Id: entropy.c,v 1.57 2001/02/05 23:00:18 bwelling Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -65,6 +65,7 @@
|
|||
* size of entropy pool in 32-bit words. This _MUST_ be a power of 2.
|
||||
*/
|
||||
#define RND_POOLWORDS 128
|
||||
#define RND_POOLBYTES (RND_POOLWORDS * 4)
|
||||
#define RND_POOLBITS (RND_POOLWORDS * 32)
|
||||
|
||||
/*
|
||||
|
|
@ -722,7 +723,7 @@ isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length,
|
|||
|
||||
isc_sha1_init(&hash);
|
||||
isc_sha1_update(&hash, (void *)(ent->pool.pool),
|
||||
RND_POOLWORDS * 4);
|
||||
RND_POOLBYTES);
|
||||
isc_sha1_final(&hash, digest);
|
||||
|
||||
/*
|
||||
|
|
@ -772,7 +773,7 @@ isc_entropypool_init(isc_entropypool_t *pool) {
|
|||
pool->entropy = 0;
|
||||
pool->pseudo = 0;
|
||||
pool->rotate = 0;
|
||||
memset(pool->pool, 0, RND_POOLWORDS);
|
||||
memset(pool->pool, 0, RND_POOLBYTES);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -781,7 +782,7 @@ isc_entropypool_invalidate(isc_entropypool_t *pool) {
|
|||
pool->entropy = 0;
|
||||
pool->pseudo = 0;
|
||||
pool->rotate = 0;
|
||||
memset(pool->pool, 0, RND_POOLWORDS);
|
||||
memset(pool->pool, 0, RND_POOLBYTES);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
|
|
|||
Loading…
Reference in a new issue