From 1449e6dd55892c92e502a14dbfc3ede094aaa806 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Tue, 15 Jan 2013 13:27:35 +0100 Subject: [PATCH] Reseed rdrand after every 128bit sample only --- src/libstrongswan/plugins/rdrand/rdrand_rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstrongswan/plugins/rdrand/rdrand_rng.c b/src/libstrongswan/plugins/rdrand/rdrand_rng.c index d032cbe31d..fa66f3ad78 100644 --- a/src/libstrongswan/plugins/rdrand/rdrand_rng.c +++ b/src/libstrongswan/plugins/rdrand/rdrand_rng.c @@ -245,7 +245,7 @@ static bool rdrand_chunk(private_rdrand_rng_t *this, chunk_t chunk) /* fill with 8 byte words */ while (chunk.len >= sizeof(u_int64_t)) { - if (this->quality == RNG_STRONG && chunk.len % FORCE_RESEED) + if (this->quality == RNG_STRONG && chunk.len % FORCE_RESEED == 0) { if (!reseed()) { @@ -274,7 +274,7 @@ static bool rdrand_chunk(private_rdrand_rng_t *this, chunk_t chunk) /* fill with 4 byte words */ while (chunk.len >= sizeof(u_int32_t)) { - if (this->quality == RNG_STRONG && chunk.len % FORCE_RESEED) + if (this->quality == RNG_STRONG && chunk.len % FORCE_RESEED == 0) { if (!reseed()) { -- 2.47.2