From: Martin Willi Date: Tue, 15 Jan 2013 12:27:35 +0000 (+0100) Subject: Reseed rdrand after every 128bit sample only X-Git-Tag: 5.0.2rc1~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1449e6dd55892c92e502a14dbfc3ede094aaa806;p=thirdparty%2Fstrongswan.git Reseed rdrand after every 128bit sample only --- 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()) {