diff options
author | Martin Willi <martin@revosec.ch> | 2013-01-15 13:27:35 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2013-01-15 17:41:54 +0100 |
commit | 1449e6dd55892c92e502a14dbfc3ede094aaa806 (patch) | |
tree | b5f5a804cc32f85d6aaf7efe453dcfb754023608 | |
parent | 13b2804204935ad588fdc494129d0bbab08875fa (diff) | |
download | strongswan-1449e6dd55892c92e502a14dbfc3ede094aaa806.tar.bz2 strongswan-1449e6dd55892c92e502a14dbfc3ede094aaa806.tar.xz |
Reseed rdrand after every 128bit sample only
-rw-r--r-- | src/libstrongswan/plugins/rdrand/rdrand_rng.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstrongswan/plugins/rdrand/rdrand_rng.c b/src/libstrongswan/plugins/rdrand/rdrand_rng.c index d032cbe31..fa66f3ad7 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()) { |